public function __construct() { parent::__construct(OW::getLanguage()->text('mailbox', 'messages_console_title'), 'mailbox'); $template = OW::getPluginManager()->getPlugin('BASE')->getCmpViewDir() . 'console_dropdown_list.html'; $this->setTemplate($template); $this->list = new MAILBOX_CMP_ConsoleList($this->getKey()); $this->addClass('ow_mailbox_items_list'); $modeList = MAILBOX_BOL_ConversationService::getInstance()->getActiveModeList(); $singleMode = count($modeList) == 1; if ($singleMode) { $this->addClass('ow_mailbox_single_mode'); } $toolbar = new MAILBOX_CMP_Toolbar(); OW::getDocument()->appendBody($toolbar->render()); }
public function onPluginInit() { $handlerAttributes = OW::getRequestHandler()->getHandlerAttributes(); $event = new OW_Event('plugin.mailbox.on_plugin_init.handle_controller_attributes', array('handlerAttributes' => $handlerAttributes)); OW::getEventManager()->trigger($event); $handleResult = $event->getData(); if ($handleResult === false) { return; } if (!OW::getUser()->isAuthenticated()) { return; } else { if (!BOL_UserService::getInstance()->isApproved()) { return; } $user = OW::getUser()->getUserObject(); if (BOL_UserService::getInstance()->isSuspended($user->getId())) { return; } if ((int) $user->emailVerify === 0 && OW::getConfig()->getValue('base', 'confirm_email')) { return; } } $im_toolbar = new MAILBOX_CMP_Toolbar(); OW::getDocument()->appendBody($im_toolbar->render()); }