getAuthIdentity() && $this->_hasNavigationBlock) { $this->_initNavigationBlock(); } return $this; } public function hasNavigationBlock($value) { $this->_hasNavigationBlock = (bool) $value; return $this; } protected function _initNavigationBlock() { $item['menu'] = $this->_getUserNavigationList(); $authData = $this->getAuthData(); $this->_prepareUserNavigation($authData, $item['menu']); $item['activeItems'] = []; $this->_getActiveIds($item['menu'], $item['activeItems']); $item['tpl'] = $this->getTemplate('navigation-block.tpl'); $this->addItem($item, 'LEFT_ITEMS'); return $this; } protected function _getActiveIds(array $menu, array &$ids) { $currentId = $this->getOption('id'); foreach ($menu as $item) { if (!empty($item['sub'])) { if ($this->_getActiveIds($item['sub'], $ids)) { $ids[] = $item['id']; return true; } } if ($item['id'] == $currentId) { $ids[] = $currentId; return true; } } return false; } }