diff --git a/assets/snippets/DocLister/core/controller/site_content_menu.php b/assets/snippets/DocLister/core/controller/site_content_menu.php index f0be9aa0b7..f7b80b0c88 100644 --- a/assets/snippets/DocLister/core/controller/site_content_menu.php +++ b/assets/snippets/DocLister/core/controller/site_content_menu.php @@ -42,7 +42,11 @@ public function getDocs($tvlist = '') $maxDepth = $this->getCFGDef('maxDepth', 10); //TODO кэширование if ($this->getCFGDef('hideSubMenus', 0) && empty($this->getCFGDef('openIds'))) { - $maxDepth = $this->setActiveBranch($this->getHereId()); + $maxDepth = min($maxDepth, $this->setActiveBranch($this->getHereId())); + if (empty(array_intersect($this->IDs, $this->activeBranch))) { + $maxDepth = 1; + $this->config->setConfig(array('hideSubMenus' => 0)); + }; } else { $this->setActiveBranch($this->getHereId()); } @@ -243,6 +247,7 @@ public function _render($tpl = '') unset($docs[$currentLevel]); $currentLevel--; } + unset($data); $out = ''; $joinMenus = $this->getCFGDef('joinMenus', 0) && !$this->getCFGDef('showParents', 0);