/** * Setup navigation. * * @return void */ protected function _setupNavigation() { $path = explode('/', $this->request->get('_url')); $activeItem = ''; $limit = count($path) > 3 ? 1 : 0; for ($i = 1, $count = count($path); $i < $count - $limit && $i < 3; $i++) { $activeItem .= $path[$i] . '/'; } $activeItem = substr($activeItem, 0, -1); $menuItems = ['admin' => ['href' => 'admin', 'title' => 'Dashboard', 'prepend' => '<i class="glyphicon glyphicon-home"></i>'], 'users' => ['title' => 'Manage', 'items' => ['admin/users' => ['title' => 'Users and Roles', 'href' => 'admin/users', 'prepend' => '<i class="glyphicon glyphicon-user"></i>'], 'admin/pages' => ['title' => 'Pages', 'href' => 'admin/pages', 'prepend' => '<i class="glyphicon glyphicon-list-alt"></i>'], 'admin/menus' => ['title' => 'Menus', 'href' => 'admin/menus', 'prepend' => '<i class="glyphicon glyphicon-th-list"></i>'], 'admin/languages' => ['title' => 'Languages', 'href' => 'admin/languages', 'prepend' => '<i class="glyphicon glyphicon-globe"></i>'], 'admin/files' => ['title' => 'Files', 'href' => 'admin/files', 'prepend' => '<i class="glyphicon glyphicon-file"></i>'], 'admin/packages' => ['title' => 'Packages', 'href' => 'admin/packages', 'prepend' => '<i class="glyphicon glyphicon-th"></i>']]], 'settings' => ['title' => 'Settings', 'items' => ['admin/settings' => ['title' => 'System', 'href' => 'admin/settings', 'prepend' => '<i class="glyphicon glyphicon-cog"></i>'], 'admin/settings/performance' => ['title' => 'Performance', 'href' => 'admin/performance', 'prepend' => '<i class="glyphicon glyphicon-signal"></i>'], 'admin/access' => ['title' => 'Access Rights', 'href' => 'admin/access', 'prepend' => '<i class="glyphicon glyphicon-lock"></i>']]]]; $modules = Package::findByType(Manager::PACKAGE_TYPE_MODULE, 1); if ($modules->count()) { $modulesMenuItems = []; foreach ($modules as $module) { if ($module->is_system) { continue; } $href = 'admin/module/' . $module->name; $modulesMenuItems[$href] = ['title' => $module->title, 'href' => $href, 'prepend' => '<i class="glyphicon glyphicon-th-large"></i>']; } if (!empty($modulesMenuItems)) { $menuItems['modules'] = ['title' => 'Modules', 'items' => $modulesMenuItems]; } } $navigation = new Navigation(); $navigation->setItems($menuItems)->setActiveItem($activeItem)->setListClass('nav nav-categories')->setDropDownItemClass('nav-category')->setDropDownItemMenuClass('nav')->setDropDownIcon('')->setEnabledDropDownHighlight(false); $this->view->headerNavigation = $navigation; }
/** * Init controller before actions. * * @return void */ public function init() { $navigation = new Navigation(); $navigation->setItems(['index' => ['href' => 'admin/menus', 'title' => 'Browse', 'prepend' => '<i class="glyphicon glyphicon-list"></i>'], 1 => ['href' => 'javascript:;', 'title' => '|'], 'create' => ['href' => 'admin/menus/create', 'title' => 'Create new menu', 'prepend' => '<i class="glyphicon glyphicon-plus-sign"></i>']]); $this->view->navigation = $navigation; }
/** * Init navigation. * * @return void */ public function init() { $navigation = new Navigation(); $navigation->setItems(['index' => ['href' => 'admin/users', 'title' => 'Users', 'prepend' => '<i class="glyphicon glyphicon-user"></i>'], 'roles' => ['href' => 'admin/users/roles', 'title' => 'Roles', 'prepend' => '<i class="glyphicon glyphicon-share"></i>'], 2 => ['href' => 'javascript:;', 'title' => '|'], 'create' => ['href' => 'admin/users/create', 'title' => 'Create new user', 'prepend' => '<i class="glyphicon glyphicon-plus-sign"></i>'], 'rolesCreate' => ['href' => 'admin/users/roles-create', 'title' => 'Create new role', 'prepend' => '<i class="glyphicon glyphicon-plus-sign"></i>']]); $this->view->navigation = $navigation; }
/** * Init controller's navigation. * * @return void */ public function init() { $navigation = new Navigation(); $navigation->setItems(['index' => ['href' => 'admin/packages', 'title' => 'Modules', 'prepend' => '<i class="glyphicon glyphicon-th-large"></i>'], 'themes' => ['href' => 'admin/packages/themes', 'title' => 'Themes', 'prepend' => '<i class="glyphicon glyphicon-leaf"></i>'], 'widgets' => ['href' => 'admin/packages/widgets', 'title' => 'Widgets', 'prepend' => '<i class="glyphicon glyphicon-tags"></i>'], 'plugins' => ['href' => ['for' => 'admin-packages-plugins'], 'title' => 'Plugins', 'prepend' => '<i class="glyphicon glyphicon-resize-full"></i>'], 'libraries' => ['href' => ['for' => 'admin-packages-libraries'], 'title' => 'Libraries', 'prepend' => '<i class="glyphicon glyphicon-book"></i>'], 2 => ['href' => 'javascript:;', 'title' => '|'], 'upload' => ['href' => 'admin/packages/upload', 'title' => 'Upload new package', 'prepend' => '<i class="glyphicon glyphicon-plus-sign"></i>'], 'create' => ['href' => 'admin/packages/create', 'title' => 'Create new package', 'prepend' => '<i class="glyphicon glyphicon-plus-sign"></i>']]); $this->view->navigation = $navigation; }