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 = []; $item['page'] = current(Qs_SiteMap::find(['id' => $blockData['pageId'], 'enabled' => 'y'])); if ($item['page']) { $item['page']['sub'] = Qs_SiteMap::filter($item['page']['sub'], ['enabled' => 'y']); } if (!$item || empty($item['page']['sub'])) { return null; } $item['tpl'] = $this->getTemplate('subpagesSideBlock.tpl'); return $item; } }