1) { $this->assign('LANGUAGES', $list); } $this->_addLoginForm(); $this->_initRightBlockContent(); $this->_initCrumbs(); $this->_initPageFiles(); $this->_initSlider(); return $this; } public function getMenu() { if (null === $this->_content['menu']) { $this->_content['menu'] = Qs_SiteMap::getMenu(); } $redirectIds = array(2, 3, 4); foreach($this->_content['menu'] as &$menuItem) { if (in_array($menuItem['id'], $redirectIds) && !empty($menuItem['sub'])) { if (false !== ($redirectItem = reset($menuItem['sub']))) { $menuItem['url'] = BASE_URL_LANGUAGE . '/' . $redirectItem['fullAlias']; } } } return $this->_content['menu']; } protected function _addLoginForm() { $formView = new App_User_Login_View(); if (!$formView->auth->isLoggedIn()) { $form = $formView->getFloatForm(); $this->assign('LOGIN_FROM', $form); } return $this; } protected function _initRightBlockContent() { $contentBlock = new App_RightBlock_View(); $item = $contentBlock->getBlockItems($this->getOption('id')); if (!empty($item)) { $this->addItem($item, 'RIGHT_ITEMS'); } return $this; } protected function _initCrumbs() { // menu accordion $this->addScript('js/app/menu-accordion.js'); if ($this->_options['handler'] == 'site') { $list = array(); $list[] = $this->_options; $list = $this->_getParentPages($this->_options['idParent'], $list); $list = array_reverse($list); $list = array_merge($list, $this->_itemCrumbs); //foreach ($list as &$page) { // if (!empty($page['fullAlias'])) { // $session = new Qs_Session_Namespace($page['fullAlias']); // $url = $session->backUrl; // if (!empty($url)) { // $page['url'] = $url; // } // } //} //unset($page); $this->assign('CRUMBS', $list); } return $this; } protected function _getParentPages($idParentPage, $pages = array()) { $idParentPage = (int) $idParentPage; $page = Qs_SiteMap::findFirst(array('id' => $idParentPage)); if (!empty($page)) { unset($page['items'], $page['sub']); $pages[] = $page; $pages = $this->_getParentPages($page['idParent'], $pages); } return $pages; } public function addItemCrumb($data) { if (is_array($data) && !empty($data)) { if (!empty($data['title']) || !empty($data['menuTitle'])) { if (empty($data['menuTitle'])) { $data['menuTitle'] = $data['title']; } $this->_itemCrumbs[] = $data; } } return $this; } protected function _initPageFiles() { $filesView = new App_AppFile_View(); $item = $filesView->getFilesItem($this->getOption('id')); if (!empty($item)) { $this->addItemFirst($item, 'RIGHT_ITEMS'); } return $this; } protected function _initSlider() { $page = Qs_SiteMap::getPage(CURRENT_PAGE_FINAL); if (in_array(strtolower(CURRENT_PAGE_FINAL), array('', 'home')) || $page['handler'] !== 'site') { return false; } $view = new App_Slide_View(array('idItem' => '4096')); $view->setDoc($this); $view->exec(); } }