isSideBlock()) { $this->_showSideBlock(); return $this; } return parent::exec(); } protected function _doView() { $item = array( 'siteMap' => Qs_SiteMap::get4Userend(), 'tpl' => $this->getTemplate('view.tpl') ); $item['siteMapPagesCount'] = App_Cms_Obj::getInstance()->getSiteMapPageCount($item['siteMap']); $this->_addItem($item); return $this; } protected function _showSideBlock() { if (!($pageId = $this->getSideBlock()->getPageId())) { $pageId = $this->_doc->getOption('idParent'); } if (!$pageId || !($page = Qs_SiteMap::findFirst(['id' => $pageId, 'enabled' => 'y'])) || !($page['sub'] = Qs_SiteMap::filter(Qs_Array::get($page, 'sub'), ['enabled' => 'y'])) ) { return $this; } $item = [ 'page' => $page, 'tpl' => $this->getTemplate('sideBlock.tpl') ]; $this->_addItem($item); return $this; } }