/** * @see OW_MasterPage::init() */ protected function init() { $language = OW::getLanguage(); OW::getThemeManager()->setCurrentTheme(BOL_ThemeService::getInstance()->getThemeObjectByName(BOL_ThemeService::DEFAULT_THEME)); $menuTypes = array(BOL_NavigationService::MENU_TYPE_ADMIN, BOL_NavigationService::MENU_TYPE_APPEARANCE, BOL_NavigationService::MENU_TYPE_PAGES, BOL_NavigationService::MENU_TYPE_PLUGINS, BOL_NavigationService::MENU_TYPE_SETTINGS, BOL_NavigationService::MENU_TYPE_USERS, BOL_NavigationService::MENU_TYPE_MOBILE); $menuItems = BOL_NavigationService::getInstance()->findMenuItemsForMenuList($menuTypes); if (defined('OW_PLUGIN_XP')) { foreach ($menuItems as $key1 => $menuType) { foreach ($menuType as $key2 => $menuItem) { if (in_array($menuItem['key'], array('sidebar_menu_plugins_add', 'sidebar_menu_themes_add'))) { unset($menuItems[$key1][$key2]); } } } } $menuDataArray = array('menu_admin' => BOL_NavigationService::MENU_TYPE_ADMIN, 'menu_users' => BOL_NavigationService::MENU_TYPE_USERS, 'menu_settings' => BOL_NavigationService::MENU_TYPE_SETTINGS, 'menu_appearance' => BOL_NavigationService::MENU_TYPE_APPEARANCE, 'menu_pages' => BOL_NavigationService::MENU_TYPE_PAGES, 'menu_plugins' => BOL_NavigationService::MENU_TYPE_PLUGINS, 'menu_mobile' => BOL_NavigationService::MENU_TYPE_MOBILE); foreach ($menuDataArray as $key => $value) { $this->menuCmps[$key] = new ADMIN_CMP_AdminMenu($menuItems[$value]); $this->addMenu($value, $this->menuCmps[$key]); } $event = new ADMIN_CLASS_NotificationCollector('admin.add_admin_notification'); OW::getEventManager()->trigger($event); $this->assign('notifications', $event->getData()); // platform info $event = new OW_Event('admin.get_soft_version_text'); OW_EventManager::getInstance()->trigger($event); $verString = $event->getData(); if (empty($verString)) { $verString = OW::getLanguage()->text('admin', 'soft_version', array('version' => OW::getConfig()->getValue('base', 'soft_version'), 'build' => OW::getConfig()->getValue('base', 'soft_build'))); } $this->assign('version', OW::getConfig()->getValue('base', 'soft_version')); $this->assign('build', OW::getConfig()->getValue('base', 'soft_build')); $this->assign('softVersion', $verString); }
/** * @see OW_MasterPage::init() */ protected function init() { $language = OW::getLanguage(); OW::getThemeManager()->setCurrentTheme(BOL_ThemeService::getInstance()->getThemeObjectByName(BOL_ThemeService::DEFAULT_THEME)); $menuTypes = array(BOL_NavigationService::MENU_TYPE_ADMIN, BOL_NavigationService::MENU_TYPE_APPEARANCE, BOL_NavigationService::MENU_TYPE_PRIVACY, BOL_NavigationService::MENU_TYPE_PAGES, BOL_NavigationService::MENU_TYPE_PLUGINS, BOL_NavigationService::MENU_TYPE_SETTINGS, BOL_NavigationService::MENU_TYPE_USERS, BOL_NavigationService::MENU_TYPE_MOBILE); $menuItems = BOL_NavigationService::getInstance()->findMenuItemsForMenuList($menuTypes); if (defined('OW_PLUGIN_XP')) { foreach ($menuItems as $key1 => $menuType) { foreach ($menuType as $key2 => $menuItem) { if (in_array($menuItem['key'], array('sidebar_menu_plugins_add', 'sidebar_menu_themes_add'))) { unset($menuItems[$key1][$key2]); } } } } $menuDataArray = array('menu_admin' => BOL_NavigationService::MENU_TYPE_ADMIN, 'menu_users' => BOL_NavigationService::MENU_TYPE_USERS, 'menu_settings' => BOL_NavigationService::MENU_TYPE_SETTINGS, 'menu_privacy' => BOL_NavigationService::MENU_TYPE_PRIVACY, 'menu_appearance' => BOL_NavigationService::MENU_TYPE_APPEARANCE, 'menu_pages' => BOL_NavigationService::MENU_TYPE_PAGES, 'menu_plugins' => BOL_NavigationService::MENU_TYPE_PLUGINS, 'menu_mobile' => BOL_NavigationService::MENU_TYPE_MOBILE); foreach ($menuDataArray as $key => $value) { $this->menuCmps[$key] = new ADMIN_CMP_AdminMenu($menuItems[$value]); $this->addMenu($value, $this->menuCmps[$key]); } // admin notifications $adminNotifications = array(); if (!defined('OW_PLUGIN_XP') && OW::getConfig()->getValue('base', 'update_soft')) { $adminNotifications[] = $language->text('admin', 'notification_soft_update', array('link' => OW::getRouter()->urlForRoute('admin_core_update_request'))); } $pluginsCount = BOL_PluginService::getInstance()->getPluginsToUpdateCount(); if (!defined('OW_PLUGIN_XP') && $pluginsCount > 0) { $adminNotifications[] = $language->text('admin', 'notification_plugins_to_update', array('link' => OW::getRouter()->urlForRoute('admin_plugins_installed'), 'count' => $pluginsCount)); } $themesCount = BOL_ThemeService::getInstance()->getThemesToUpdateCount(); if (!defined('OW_PLUGIN_XP') && $themesCount > 0) { $adminNotifications[] = $language->text('admin', 'notification_themes_to_update', array('link' => OW::getRouter()->urlForRoute('admin_themes_choose'), 'count' => $themesCount)); } $event = new BASE_CLASS_EventCollector('admin.add_admin_notification'); OW::getEventManager()->trigger($event); $adminNotifications = array_merge($adminNotifications, $event->getData()); $this->assign('notifications', $adminNotifications); $adminWarnings = array(); if (!defined('OW_PLUGIN_XP') && OW::getConfig()->configExists('base', 'cron_is_active') && (int) OW::getConfig()->getValue('base', 'cron_is_active') === 0) { $adminWarnings[] = $language->text('admin', 'warning_cron_is_not_active', array('path' => OW_DIR_ROOT . 'ow_cron' . DS . 'run.php')); } if (!defined('OW_PLUGIN_XP') && !ini_get('allow_url_fopen')) { $adminWarnings[] = $language->text('admin', 'warning_url_fopen_disabled'); } $event = new BASE_CLASS_EventCollector('admin.add_admin_warning'); OW::getEventManager()->trigger($event); $adminWarnings = array_merge($adminWarnings, $event->getData()); $this->assign('warnings', $adminWarnings); // platform info $event = new OW_Event('admin.get_soft_version_text'); OW_EventManager::getInstance()->trigger($event); $verString = $event->getData(); if (empty($verString)) { $verString = OW::getLanguage()->text('admin', 'soft_version', array('version' => OW::getConfig()->getValue('base', 'soft_version'), 'build' => OW::getConfig()->getValue('base', 'soft_build'))); } $this->assign('version', OW::getConfig()->getValue('base', 'soft_version')); $this->assign('build', OW::getConfig()->getValue('base', 'soft_build')); $this->assign('softVersion', $verString); }
public function findUserIdListByQuestionValues($questionValues, $first, $count, $isAdmin = false, $aditionalParams = array()) { $first = (int) $first; $count = (int) $count; $data = array('data' => $questionValues, 'first' => $first, 'count' => $count, 'isAdmin' => $isAdmin, 'aditionalParams' => $aditionalParams); $event = new OW_Event("base.question.before_user_search", $data, $data); OW_EventManager::getInstance()->trigger($event); $data = $event->getData(); return $this->userDao->findUserIdListByQuestionValues($data['data'], $data['first'], $data['count'], $data['isAdmin'], $data['aditionalParams']); }
/** * Returns system event manager object. * * @return OW_EventManager */ public static function getEventManager() { return OW_EventManager::getInstance(); }