本文整理汇总了PHP中OW_ActionController::init方法的典型用法代码示例。如果您正苦于以下问题:PHP OW_ActionController::init方法的具体用法?PHP OW_ActionController::init怎么用?PHP OW_ActionController::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OW_ActionController
的用法示例。
在下文中一共展示了OW_ActionController::init方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* @see OW_ActionController::init()
*
*/
public function init()
{
parent::init();
$language = OW::getLanguage();
$this->setPageHeading($language->text('mailbox', 'mailbox'));
$this->setPageHeadingIconClass('ow_ic_mail');
}
示例2: init
/**
* @see OW_ActionController::init()
*
*/
public function init()
{
parent::init();
$language = OW::getLanguage();
$item = new BASE_MenuItem();
$item->setLabel($language->text('mailbox', 'inbox_label'));
$item->setIconClass('ow_ic_down_arrow');
$item->setUrl(OW::getRouter()->urlForRoute("mailbox_default"));
$item->setKey('inbox');
$item->setOrder(1);
$menuItems[] = $item;
$item = new BASE_MenuItem();
$item->setLabel($language->text('mailbox', 'sent_label'));
$item->setIconClass('ow_ic_up_arrow');
$item->setUrl(OW::getRouter()->urlForRoute("mailbox_sent"));
$item->setKey('sent');
$item->setOrder(2);
$menuItems[] = $item;
$event = new BASE_CLASS_EventCollector('mailbox.collect_menu_items');
OW::getEventManager()->trigger($event);
foreach ($event->getData() as $menuItem) {
$menuItems[] = $menuItem;
}
$this->contentMenu = new BASE_CMP_ContentMenu($menuItems);
$this->addComponent("mailbox_menu", $this->contentMenu);
$this->setPageHeading($language->text('mailbox', 'mailbox'));
$this->setPageHeadingIconClass('ow_ic_mail');
$this->recordsToPage = (int) OW::getConfig()->getValue('mailbox', 'results_per_page');
if ($this->recordsToPage === 0) {
$this->recordsToPage = self::MAILBOX_RECORDS_TO_PAGE;
}
}
示例3: init
public function init()
{
parent::init();
if (!OW::getUser()->isAuthenticated()) {
throw new AuthenticateException();
}
}
示例4: init
public function init()
{
parent::init();
$handler = OW::getRequestHandler()->getHandlerAttributes();
if (!in_array($handler[OW_RequestHandler::ATTRS_KEY_VARLIST]['category'], array(BOOKMARKS_BOL_Service::LIST_LATEST, BOOKMARKS_BOL_Service::LIST_ONLINE))) {
throw new Redirect404Exception();
}
$this->getComponent('sort')->setActive($handler[OW_RequestHandler::ATTRS_KEY_VARLIST]['category']);
}
示例5: init
public function init()
{
parent::init();
if (!OW::getUser()->isAuthenticated()) {
throw new AuthenticateException();
}
if (!OW::getUser()->isAuthorized('video', 'add')) {
$this->returnResponse(array('status' => self::STATUS_ERROR, 'result' => FALSE, 'msg' => OW::getLanguage()->text('spvideolite', 'auth_upload_permissions')));
}
}
示例6: init
public function init()
{
parent::init();
$hadler = OW::getRequestHandler()->getHandlerAttributes();
if (OW::getUser()->isAuthenticated()) {
switch ($hadler[OW_RequestHandler::ATTRS_KEY_ACTION]) {
case 'view':
$ownerMode = $this->photoService->findPhotoOwner($hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['id']) == OW::getUser()->getId();
$contentOwner = $this->photoService->findPhotoOwner((int) $hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['id']);
break;
case 'getFloatbox':
$ownerMode = $this->photoService->findPhotoOwner($_POST['photoId']) == OW::getUser()->getId();
break;
case 'userAlbums':
case 'userPhotos':
$ownerMode = $hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['user'] == OW::getUser()->getUserObject()->username;
$contentOwner = ($user = BOL_UserService::getInstance()->findByUsername($hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['user'])) !== NULL ? $user->id : 0;
break;
case 'userAlbum':
$ownerMode = $this->photoAlbumService->isAlbumOwner($hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['album'], OW::getUser()->getId());
$contentOwner = ($album = $this->photoAlbumService->findAlbumById((int) $hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['album'])) !== NULL ? $album->userId : 0;
break;
case 'ajaxResponder':
switch ($_POST['ajaxFunc']) {
case 'getAlbumList':
$ownerMode = $_POST['userId'] == OW::getUser()->getId();
break;
case 'getPhotoList':
$ownerMode = !empty($_POST['userId']) && $_POST['userId'] == OW::getUser()->getId();
break;
case 'ajaxDeletePhotos':
case 'ajaxMoverToAlbum':
$ownerMode = $this->photoAlbumService->isAlbumOwner($_POST['albumId'], OW::getUser()->getId());
break;
case 'ajaxSetFeaturedStatus':
case 'setAsAvatar':
$ownerMode = $this->photoService->findPhotoOwner($_POST['entityId']) == OW::getUser()->getId();
break;
default:
$ownerMode = FALSE;
break;
}
break;
case 'ajaxUpdatePhoto':
$ownerMode = $this->photoService->findPhotoOwner($_POST['photoId']) == OW::getUser()->getId();
break;
case 'downloadPhoto':
$ownerMode = $this->photoService->findPhotoOwner($hadler[OW_RequestHandler::ATTRS_KEY_VARLIST]['id']) == OW::getUser()->getId();
break;
case 'ajaxUpdateAlbum':
$ownerMode = $this->photoAlbumService->isAlbumOwner($_POST['album-id'], OW::getUser()->getId());
break;
case 'ajaxCreateAlbum':
$ownerMode = TRUE;
break;
default:
$ownerMode = FALSE;
break;
}
} else {
$ownerMode = FALSE;
}
$modPermissions = OW::getUser()->isAuthorized('photo');
$isAuthorized = OW::getUser()->isAuthorized('photo', 'view');
if (!$ownerMode && !$modPermissions && !$isAuthorized) {
if (OW::getRequest()->isAjax()) {
exit(json_encode(array('result' => FALSE, 'status' => 'error', 'msg' => OW::getLanguage()->text('photo', 'auth_view_permissions'))));
} else {
$this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCtrlViewDir() . 'authorization_failed.html');
return;
}
}
if (!empty($contentOwner) && !$ownerMode && !$modPermissions) {
$privacyParams = array('action' => 'photo_view_album', 'ownerId' => $contentOwner, 'viewerId' => OW::getUser()->getId());
$event = new OW_Event('privacy_check_permission', $privacyParams);
OW::getEventManager()->trigger($event);
}
if (OW::getRequest()->isAjax() || in_array($hadler[OW_RequestHandler::ATTRS_KEY_ACTION], array('downloadPhoto', 'approve'))) {
return;
}
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'photo', 'photo');
if ($hadler[OW_RequestHandler::ATTRS_KEY_ACTION] != 'view') {
$this->addComponent('pageHead', OW::getClassInstance('PHOTO_CMP_PageHead', $ownerMode, !empty($album) ? $album : NULL));
}
}
示例7: init
public function init()
{
parent::init();
$this->service = UTAGS_BOL_Service::getInstance();
}