本文整理汇总了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);
}
}