public function staticDocument($params) { $navService = BOL_NavigationService::getInstance(); if (empty($params['documentKey'])) { throw new Redirect404Exception(); } $language = OW::getLanguage(); $documentKey = $params['documentKey']; $document = $navService->findDocumentByKey($documentKey); if ($document === null) { throw new Redirect404Exception(); } $menuItem = $navService->findMenuItemByDocumentKey($document->getKey()); if ($menuItem !== null) { if (!$menuItem->getVisibleFor() || $menuItem->getVisibleFor() == BOL_NavigationService::VISIBLE_FOR_GUEST && OW::getUser()->isAuthenticated()) { throw new Redirect403Exception(); } if ($menuItem->getVisibleFor() == BOL_NavigationService::VISIBLE_FOR_MEMBER && !OW::getUser()->isAuthenticated()) { throw new AuthenticateException(); } } $settings = BOL_MobileNavigationService::getInstance()->getItemSettings($menuItem); $title = $settings[BOL_MobileNavigationService::SETTING_TITLE]; $this->assign('content', $settings[BOL_MobileNavigationService::SETTING_CONTENT]); $this->setPageHeading($settings[BOL_MobileNavigationService::SETTING_TITLE]); $this->setPageTitle($settings[BOL_MobileNavigationService::SETTING_TITLE]); $this->setDocumentKey($document->getKey()); //OW::getEventManager()->bind(OW_EventManager::ON_BEFORE_DOCUMENT_RENDER, array($this, 'setCustomMetaInfo')); }
/** * Returns an instance of class (singleton pattern implementation). * * @return BOL_MobileNavigationService */ public static function getInstance() { if (self::$classInstance === null) { self::$classInstance = new self(); } return self::$classInstance; }
public function process() { $values = $this->getValues(); BOL_MobileNavigationService::getInstance()->editItem($this->menuItem, $values); $items = array(); $items[$values["key"]] = array("title" => $values[BOL_MobileNavigationService::SETTING_LABEL]); return array("items" => $items); }
public function __construct($itemKey) { parent::__construct(); list($prefix, $key) = explode(':', $itemKey); $menuItem = BOL_NavigationService::getInstance()->findMenuItem($prefix, $key); $custom = $menuItem->getPrefix() == BOL_MobileNavigationService::MENU_PREFIX; $form = new ADMIN_CLASS_MobileNavigationItemSettingsForm($menuItem, $custom); $this->addForm($form); $settings = BOL_MobileNavigationService::getInstance()->getItemSettings($menuItem); $this->assign("settings", $settings); $this->assign("custom", $custom); $js = UTIL_JsGenerator::composeJsString('owForms[{$formName}].bind("success", function(r) { _scope.callBack(r); _scope.floatBox.close(); })', array("formName" => $form->getName())); OW::getDocument()->addOnloadScript($js); }
public function saveOrder($data, $shared) { $mobileNavigationService = BOL_MobileNavigationService::getInstance(); $navigationService = BOL_NavigationService::getInstance(); $response = array(); $response["items"] = array(); foreach ($data["panels"] as $menu => $items) { $order = 0; foreach ($items as $item) { list($prefix, $key) = explode(':', $item); $menuItem = $navigationService->findMenuItem($prefix, $key); if ($menuItem === null) { $menuItem = $mobileNavigationService->createEmptyItem($menu, $order); } else { $menuItem->setOrder($order); $menuItem->setType($menu); $navigationService->saveMenuItem($menuItem); } $order++; $settings = BOL_MobileNavigationService::getInstance()->getItemSettingsByPrefixAndKey($menuItem->prefix, $menuItem->key); $response["items"][$item] = array("key" => $menuItem->getPrefix() . ':' . $menuItem->getKey(), "title" => $settings[BOL_MobileNavigationService::SETTING_LABEL], "custom" => $menuItem->getPrefix() == BOL_MobileNavigationService::MENU_PREFIX); } } return $response; }
public function deleteItem($data, $shared) { $mobileNavigationService = BOL_MobileNavigationService::getInstance(); $navigationService = BOL_NavigationService::getInstance(); list($prefix, $key) = explode(':', $data["key"]); $menuItem = $navigationService->findMenuItem($prefix, $key); if ($menuItem === null) { return; } $mobileNavigationService->deleteItem($menuItem); }