getConfig('type')) { $this->_action = 'subpages'; } return parent::exec(); } protected function _doView() { $item = [ '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 = []) { if (empty($blockData['pageId'])) { return null; } $item = []; if (!($pages = Qs_SiteMap::find(['id' => $blockData['pageId']]))) { return null; } $item['page'] = current($pages); if (!$item || empty($item['page']['sub'])) { return null; } $item['tpl'] = $this->getTemplate('subpagesSideBlock.tpl'); return $item; } }