/** * Prepare the taskbar for the API module * @param zibo\library\admin\view\taskbar\Taskbar $taskbar * @return null */ public function prepareTaskbar(Taskbar $taskbar) { $translator = I18n::getInstance()->getTranslator(); $settingsMenu = $taskbar->getSettingsMenu(); $systemMenu = $settingsMenu->getItem($translator->translate(BaseView::TRANSLATION_TASKBAR_SYSTEM)); $systemMenu->addMenuItem(new MenuItem($translator->translate(self::TRANSLATION_API), self::ROUTE_API)); }
/** * Render this taskbar view * @param boolean $return true to return the rendered view, false to send it to the client * @return mixed null when provided $return is set to true; the rendered output when the provided $return is set to false */ public function render($return = true) { $request = Zibo::getInstance()->getRequest(); if (!$request) { return; } $baseUrl = $request->getBaseUrl() . Request::QUERY_SEPARATOR; $renderedPanels = array(); $notificationPanels = $this->taskbar->getNotificationPanels(); foreach ($notificationPanels as $panel) { $renderedPanels[] = $this->renderView($panel); } $applicationsMenu = $this->taskbar->getApplicationsMenu(); $applicationsMenu->setBaseUrl($baseUrl); $settingsMenu = $this->taskbar->getSettingsMenu(); $settingsMenu->setBaseUrl($baseUrl); $settingsMenu->orderItems(); $this->set('applicationsMenu', $applicationsMenu); $this->set('settingsMenu', $settingsMenu); $this->set('notificationPanels', array_reverse($renderedPanels)); $this->set('title', $this->taskbar->getTitle()); $this->addStyle(self::STYLE_TASKBAR); $this->addJavascript(self::SCRIPT_CLICKMENU); $this->addInlineJavascript("\$('#taskbarApplications').clickMenu({start: 'left'}); \n \t\t\t\t" . "\$('#taskbarSettings').clickMenu({start: 'right'});"); return parent::render($return); }
/** * Adds the manager menu to the application menu on the provided taskbar * @param zibo\admin\view\taskbar\Taskbar $taskbar * @return null */ public function prepareTaskbar(Taskbar $taskbar) { $managerModel = ManagerModel::getInstance(); $basePath = self::getManagerBasePath(); $managerActions = $managerModel->getManagerMenuActions($basePath); if (!$managerActions) { return; } $translator = I18n::getInstance()->getTranslator(); $managerLabel = $translator->translate(self::TRANSLATION_MANAGE); $managerMenu = $this->createMenuFromActions($managerLabel, $managerActions); $applicationsMenu = $taskbar->getApplicationsMenu(); $applicationsMenu->addMenu($managerMenu); }
/** * Add the orm menu to the taskbar * @param zibo\admin\view\taskbar\Taskbar $taskbar * @return null */ public function prepareTaskbar(Taskbar $taskbar) { $translator = I18n::getInstance()->getTranslator(); $ormMenu = new Menu($translator->translate('orm.title')); $ormMenu->addMenuItem(new MenuItem($translator->translate('orm.title.models'), self::ROUTE_ADMIN)); $ormMenu->addMenuItem(new MenuItem($translator->translate('orm.title.log'), self::ROUTE_LOG)); $settingsMenu = $taskbar->getSettingsMenu(); $settingsMenu->addMenu($ormMenu); }
/** * Prepares the taskbar and adds it to the view * @return null */ protected function addTaskbar() { $securityModel = SecurityManager::getInstance()->getSecurityModel(); $translator = $this->getTranslator(); $systemMenu = new Menu($translator->translate(self::TRANSLATION_TASKBAR_SYSTEM)); $systemMenu->addMenuItem(new MenuItem($translator->translate(LocalesController::TRANSLATION_TITLE), Module::ROUTE_LOCALES)); $systemMenu->addMenuItem(new MenuItem($translator->translate(ModulesController::TRANSLATION_TITLE), Module::ROUTE_MODULES)); if ($securityModel) { $systemMenu->addMenuItem(new MenuItem($translator->translate(SecurityController::TRANSLATION_TITLE), Module::ROUTE_SECURITY)); } $systemMenu->addMenuItem(new MenuItem($translator->translate(SystemController::TRANSLATION_TITLE), Module::ROUTE_SYSTEM)); $settingsMenu = $this->taskbar->getSettingsMenu(); $settingsMenu->addMenu($systemMenu); Zibo::getInstance()->runEvent(self::EVENT_TASKBAR, $this->taskbar); if ($securityModel) { $this->taskbar->addNotificationPanel(new UserPanelView()); } $view = new TaskbarView($this->taskbar); $this->setSubview('taskbar', $view); }
/** * Prepare the taskbar by adding the dashboard application to it * @param zibo\admin\view\taskbar\Taskbar $taskbar * @return null */ public function prepareTaskbar(Taskbar $taskbar) { $translator = I18n::getInstance()->getTranslator(); $applicationsMenu = $taskbar->getApplicationsMenu(); $applicationsMenu->addMenuItem(new MenuItem($translator->translate('dashboard.title'), 'dashboard')); }
/** * Add the menu item for the Joppa application to the taskbar * @param zibo\admin\view\taskbar\Taskbar $taskbar * @return null */ public function prepareTaskbar(Taskbar $taskbar) { $translator = I18n::getInstance()->getTranslator(); $menu = $taskbar->getApplicationsMenu(); $menu->addMenuItem(new MenuItem($translator->translate(self::TRANSLATION_APPLICATION), self::ROUTE_JOPPA)); $menu = $taskbar->getSettingsMenu(); $menu->addMenuItem(new MenuItem($translator->translate(self::TRANSLATION_SETTINGS), self::ROUTE_ADMIN)); }
/** * Adds the users administration menu item to the taskbar * @return null */ public function prepareTaskbar(Taskbar $taskbar) { $translator = I18n::getInstance()->getTranslator(); $menuSettings = $taskbar->getSettingsMenu(); $menuSettings->addMenuItem(new MenuItem($translator->translate(self::TRANSLATION_USERS), self::ROUTE_USERS)); }
/** * Adds a menu item for the XML-RPC client to the taskbar * @param zibo\admin\view\taskbar\Taskbar $taskbar The taskbar * @return null */ public function addApplication($taskbar) { $translator = I18n::getInstance()->getTranslator(); $applicationsMenu = $taskbar->getApplicationsMenu(); $applicationsMenu->addMenuItem(new MenuItem($translator->translate('xmlrpc.title.client'), 'xmlrpc/client')); }
/** * Adds the file browser to the application menu * @param zibo\admin\view\taskbar\Taskbar $taskbar * @return null */ public function prepareTaskbar(Taskbar $taskbar) { $translator = I18n::getInstance()->getTranslator(); $menuApplications = $taskbar->getApplicationsMenu(); $menuApplications->addMenuItem(new MenuItem($translator->translate(self::TRANSLATION_FILE_BROWSER), self::ROUTE_FILE_BROWSER)); }