model = $album; $this->addJs('/modules/backend/behaviors/reordercontroller/assets/js/october.reorder.js', 'core'); $this->pageTitle = Lang::get('graker.photoalbums::lang.plugin.reorder_title', ['name' => $album->title]); return $this->makePartial('reorder', ['reorderRecords' => $this->model->photos,]); } /** * Callback to save reorder information * Calls function from Sortable trait on the model */ public function onReorder() { if (!$ids = post('record_ids')) return; if (!$orders = post('sort_orders')) return; $model = new Photo(); $model->setSortableOrder($ids, $orders); } /** * Reorder constructor */ public function __construct() { parent::__construct(); BackendMenu::setContext('Graker.PhotoAlbums', 'photoalbums', 'albums'); } }