本文整理匯總了PHP中Portlet::onInit方法的典型用法代碼示例。如果您正苦於以下問題:PHP Portlet::onInit方法的具體用法?PHP Portlet::onInit怎麽用?PHP Portlet::onInit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Portlet
的用法示例。
在下文中一共展示了Portlet::onInit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: onInit
public function onInit($param)
{
parent::onInit($param);
if (!$this->Page->IsPostBack && ($keyword = $this->Request['keyword']) !== null) {
$this->Keyword->Text = $keyword;
}
}
示例2: onInit
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);
}
}