示例#1
0
 public function render($view = null, $layout = null)
 {
     // Send sidebar items
     $sidebar = Sidebar::getItems();
     $this->set('sidebar', Sort::recursiveUsort($sidebar));
     return parent::render($view, $layout);
 }
示例#2
0
 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());
 }
示例#3
0
 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);
 }
示例#4
0
 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);
 }