Fixed bug #11224: Special menu directory only renders 1st level if special.value...
authorFrancois Suter <francois.suter@typo3.org>
Sun, 20 Sep 2009 16:27:12 +0000 (16:27 +0000)
committerFrancois Suter <francois.suter@typo3.org>
Sun, 20 Sep 2009 16:27:12 +0000 (16:27 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6017 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_menu.php

index 0134a2c..870df36 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@
        * Fixed bug #12010: Task uid should be displayed in Scheduler's BE module list view
        * Follow-up to UI-Bug #F3282: Changed icon_warning.gif to match flash messages' warning icon
        * Fixed bug #11995: Prompt for keyboard input does not get displayed in CLI scripts
+       * Fixed bug #11224: Special menu directory only renders 1st level if special.value is a mount point (Thanks to Xavier Perseguers)
 
 2009-09-20  Benjamin Mack  <benni@typo3.org>
 
index d0f2485..f1786a3 100644 (file)
@@ -328,13 +328,23 @@ class tslib_menu {
 
                                // 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 (except "directory") are used.
-                       $startLevel = $directoryLevel?$directoryLevel:$this->entryLevel;
-                       if (is_array($this->tmpl->rootLine[$startLevel+$this->menuNumber]))     {
+                       $startLevel = $directoryLevel ? $directoryLevel : $this->entryLevel;
+                       $currentLevel = $startLevel + $this->menuNumber;
+                       if (is_array($this->tmpl->rootLine[$currentLevel])) {
                                $nextMParray = $this->MP_array;
-                               if ($this->tmpl->rootLine[$startLevel+$this->menuNumber]['_MOUNT_OL'])  {       // In overlay mode, add next level MPvars as well:
-                                       $nextMParray[] = $this->tmpl->rootLine[$startLevel+$this->menuNumber]['_MP_PARAM'];
+                               if (!count($nextMParray) && !$this->tmpl->rootLine[$currentLevel]['_MOUNT_OL'] && $currentLevel > 0) {
+                                               // Make sure to slide-down any mount point information (_MP_PARAM) to children records in the rootline
+                                               // otherwise automatic expansion will not work
+                                       $parentRecord = $this->tmpl->rootLine[$currentLevel - 1];
+                                       if (isset($parentRecord['_MP_PARAM'])) {
+                                               $nextMParray[] = $parentRecord['_MP_PARAM'];
+                                       }
+                               }
+                               
+                               if ($this->tmpl->rootLine[$currentLevel]['_MOUNT_OL']) {        // In overlay mode, add next level MPvars as well:
+                                       $nextMParray[] = $this->tmpl->rootLine[$currentLevel]['_MP_PARAM'];
                                }
-                               $this->nextActive = $this->tmpl->rootLine[$startLevel+$this->menuNumber]['uid'].(count($nextMParray)?':'.implode(',',$nextMParray):'');
+                               $this->nextActive = $this->tmpl->rootLine[$currentLevel]['uid'] . (count($nextMParray) ? ':' . implode(',', $nextMParray) : '');
                        } else {
                                $this->nextActive = '';
                        }