/** * Initializaction. */ public function init() { parent::init(); if ($this->template->hasTag('UserMenu')) { if (isset($this->app->auth)) { $this->user_menu = $this->add('Menu_Horizontal', null, 'UserMenu'); /** @type Menu_Horizontal $this->user_menu */ $this->user_menu->addMenu($this->app->auth->model[$this->app->auth->model->title_field]); $this->user_menu->addItem('Logout', 'logout'); } else { $this->template->tryDel('UserMenu'); $this->template->tryDel('user_icon'); } } }
/** * @todo Description */ public function initLayout() { if ($this->pathfinder->sandbox) { $this->initAddons(); } else { if (preg_match('/^sandbox_/', $this->app->page)) { $this->app->redirect('sandbox'); } } $this->addLayout('mainMenu'); parent::initLayout(); $this->initTopMenu(); if (!$this->pathfinder->sandbox && !$this->app->getConfig('production', false)) { $this->menu->addItem(array('Install Developer Toools', 'icon' => 'tools'), 'sandbox'); } if (@$this->sandbox) { $this->sandbox->initLayout(); } }