Esempio n. 1
0
 /**
  * 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);
 }
Esempio n. 2
0
 /**
  * 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));
 }
Esempio n. 3
0
 /**
  * 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);
 }
Esempio n. 4
0
 /**
  * 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);
 }
Esempio n. 5
0
 /**
  * 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));
 }
Esempio n. 6
0
 /**
  * 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));
 }