getConfig('type')) { $this->_action = 'subpages'; } 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 _doSubpages() { $blockData = [ 'pageId' => $this->getConfig('pageId') ]; if (($item = $this->getSideBlockItem($blockData))) { $item['tpl'] = $this->getTemplate('subpagesPageBlock.tpl'); $this->_doc->addItem($item); } } public function getSideBlockItem(array $blockData = array()) { if (empty($blockData['pageId'])) { return null; } $item = array(); $page = Qs_SiteMap::find(array('id' => $blockData['pageId'])); $item['page'] = $page ? current($page) : false; if (!$item || empty($item['page']['sub'])) { return null; } $item['tpl'] = $this->getTemplate('subpagesSideBlock.tpl'); return $item; } }