protected function startup() { parent::startup(); // block Internet Explorer browser itself (force to use Google Chrome Frame) // $this->blockIE(); //canonicalization for non-existing flash messages if (!empty($this->params[self::FLASH_KEY]) && !$this->hasFlashSession()) { $params = $this->params; unset($params[self::FLASH_KEY]); $this->redirect(IHttpResponse::S301_MOVED_PERMANENTLY, 'this', $params); } // if (Environment::getConfig('langs')->multipleLangs) { $this->setSupportedLangs(); $this->checkAndRegisterLang(); // } $this->registerTranslator(); $this->registerUser(); Environment::setVariable('basePath', substr(Environment::getVariable('baseUri'), 0, -1)); UserPanel::register()->addCredentials('admin', 'adminHeslo')->addCredentials('user', 'userHeslo')->setNameColumn('username'); }
protected function getLeft() { $items = MenuDB::getMainMenu(); $mainmenu = new MainMenu(); $mainmenu->uri = $this->url_active; $mainmenu->items = $items; //меню левое $user_panel = ""; if ($this->auth_user) { //панель пользователя для авторизированного $user_panel = new UserPanel(); $user_panel->user = $this->auth_user; $user_panel->uri = $this->url_active; $user_panel->addItem("Редактировать профиль", URL::get("editprofile", "user")); $user_panel->addItem("Выход", URL::get("logout")); } else { $user_panel = ""; } return $user_panel . $mainmenu; }
protected function getLeft() { $items = MenuDB::getMainMenu(); $mainmenu = new MainMenu(); $mainmenu->uri = $this->url_active; $mainmenu->items = $items; if ($this->auth_user) { $user_panel = new UserPanel(); $user_panel->user = $this->auth_user; $user_panel->uri = $this->url_active; $user_panel->addItem("Редактировать профиль", URL::get("editprofile", "user")); $user_panel->addItem("Выход", URL::get("logout")); } else { $user_panel = ""; } $poll_db = new PollDB(); $poll_db->loadRandom(); if ($poll_db->isSaved()) { $poll = new Poll(); $poll->action = URL::get("poll", "", array("id" => $poll_db->id)); $poll->title = $poll_db->title; $poll->data = PollDataDB::getAllOnPollID($poll_db->id); } else { $poll = ""; } return $user_panel . $mainmenu . $poll; }