public function render($view = null, $layout = null) { // Send sidebar items $sidebar = Sidebar::getItems(); $this->set('sidebar', Sort::recursiveUsort($sidebar)); return parent::render($view, $layout); }
public static function registerTab(SettingsTab $tab) { if (self::tabIsRegistered($tab->getID())) { throw new \Exception('Tab ' . $tab->getID() . ' is already registered.'); } self::$_tabs[] = $tab; Sidebar::addSubItem('settings', $tab->getName(), ['_name' => 'settings', 'tab' => $tab->getID()], $tab->getIcon(), $tab->getPosition()); }
public function init($event) { Sidebar::addItem('settings', __('Paramètres'), ['_name' => 'settings', 'tab' => 'general'], 'fa fa-cogs', 15); $general = (new SettingsTab('general'))->setName(__('Général'))->setPosition(1); Settings::registerTab($general); $name = (new Setting('name'))->setType('varchar')->setTab('general')->setEditable(true)->setAttributes(['label' => __('Titre du site')]); $slogan = (new Setting('slogan'))->setType('varchar')->setTab('general')->setEditable(true)->setAttributes(['label' => __('Slogan')]); $debug = (new Setting('debug'))->setType('boolean')->setTab('general')->setEditable(true)->setAttributes(['label' => __('Mode débogage')]); Settings::registerSetting($name); Settings::registerSetting($slogan); Settings::registerSetting($debug); }
public function beforeFilter(Event $event) { parent::beforeFilter($event); $this->createView(AdminView::class); Sidebar::addItem('dashboard', __('Tableau de bord'), ['controller' => 'Pages', 'action' => 'dashboard'], 'fa fa-dashboard', 1); }