--- /var/www/typo370_src_egotchi/tslib/class.tslib_menu.php Tue Dec 21 12:54:27 2004 +++ ./class.tslib_menu.php Tue Dec 21 12:50:53 2004 @@ -271,14 +271,29 @@ } } + // Set $this->directoryLevel so the following evalution of the nextActive will not return + // an invalid value if .special=directory was set + if ($this->conf['special'] == 'directory') { + $value = $this->conf['special.']['value']; + $items=t3lib_div::intExplode(',',$value); + $idx = 0; + foreach($this->tmpl->rootLine as $page) { + if (t3lib_div::inArray($items, $page['uid'])) { + $this->directoryLevel = $idx; + break; + } + $idx++; + } + } + // Setting "nextActive": This is the page uid + MPvar of the NEXT page in rootline. Used to expand the menu if we are in the right branch of the tree // Notice: The automatic expansion of a menu is designed to work only when no "special" modes are used. - if (is_array($this->tmpl->rootLine[$this->entryLevel+$this->menuNumber])) { + if (is_array($this->tmpl->rootLine[$this->entryLevel+$this->menuNumber+$this->directoryLevel])) { $nextMParray = $this->MP_array; - if ($this->tmpl->rootLine[$this->entryLevel+$this->menuNumber]['_MOUNT_OL']) { // In overlay mode, add next level MPvars as well: - $nextMParray[] = $this->tmpl->rootLine[$this->entryLevel+$this->menuNumber]['_MP_PARAM']; + if ($this->tmpl->rootLine[$this->entryLevel+$this->menuNumber+$this->directoryLevel]['_MOUNT_OL']) { // In overlay mode, add next level MPvars as well: + $nextMParray[] = $this->tmpl->rootLine[$this->entryLevel+$this->menuNumber+$this->direcotryLevel]['_MP_PARAM']; } - $this->nextActive = $this->tmpl->rootLine[$this->entryLevel+$this->menuNumber]['uid']. + $this->nextActive = $this->tmpl->rootLine[$this->entryLevel+$this->menuNumber+$this->directoryLevel]['uid']. (count($nextMParray)?':'.implode(',',$nextMParray):''); } else { $this->nextActive = ''; @@ -300,7 +315,7 @@ $GLOBALS['TT']->setTSlogMessage('ERROR in menu',3); $retVal = FALSE; } - return $retVal; + return $retVal; } /**