public function onInit($param) { parent::onInit($param); if (!$this->Page->IsPostBack && ($keyword = $this->Request['keyword']) !== null) { $this->Keyword->Text = $keyword; } }
public function onInit($param) { parent::onInit($param); $this->logout->Text = Prado::localize('Logout', array(), "messages"); $this->generateMenu(); $user = $this->application->getUser(); if ($user) { $p = $this->getService()->getRequestedPagePath(); if ($user->getIsGuest() || $p == 'install.install' || $p == 'login.login') { $this->setVisible(false); } else { $this->onDispAlarm(null, null); $this->generateShortcut($user->getUserId()); $db = $this->Application->getModule('horuxDb')->DbConnection; $db->Active = true; $sqlHome = "SELECT * FROM hr_superusers AS s LEFT JOIN hr_superuser_group AS sg ON s.group_id=sg.id WHERE s.id=" . $user->getUserId(); $cmd = $db->createCommand($sqlHome); $data = $cmd->query(); $data = $data->read(); if ($data) { $this->Home->setNavigateUrl($this->Service->constructUrl($data['defaultPage'])); } else { $this->Home->setNavigateUrl($this->Service->constructUrl('controlPanel.ControlPanel')); } } } else { $this->setVisible(false); } }