Fixed bug #11562: Main module does not load different navFrames in submodules
[Packages/TYPO3.CMS.git] / typo3 / classes / class.modulemenu.php
index dae6fc7..d4603f7 100644 (file)
@@ -452,6 +452,12 @@ class ModuleMenu {
                                top.currentSubScript = "'.$subModuleData['originalLink'].'";
                                if (top.content.list_frame && top.fsMod.currentMainLoaded == mainModName) {
                                        modScriptURL = "'.$this->appendQuestionmarkToLink($subModuleData['originalLink']).'"'.$additionalJavascript.';
+                                       ';
+                                                               // Change link to navigation frame if submodule has it's own navigation
+                                                       if ($submoduleNavigationFrameScript) {
+                                                               $javascriptCommand .= 'navFrames["' . $parentModuleName . '"] = "'. $submoduleNavigationFrameScript . '";';
+                                                       }
+                                                       $javascriptCommand .= '
                                } else if (top.nextLoadModuleUrl) {
                                        modScriptURL = "'.($subModuleData['prefix'] ? $this->appendQuestionmarkToLink($subModuleData['link']) . '&exScript=' : '') . 'listframe_loader.php";
                                } else {
@@ -480,20 +486,25 @@ class ModuleMenu {
                var additionalGetVariables = "";
                if (addGetVars) {
                        additionalGetVariables = addGetVars;
+               }';
+
+               $javascriptCode .= '
+               var navFrames = {};';
+               foreach ($navFrameScripts as $mainMod => $frameScript) {
+                       $javascriptCode .= '
+                               navFrames["'.$mainMod.'"] = "'.$frameScript.'";';
                }
 
+               $javascriptCode .= '
+
                var cMR = (cMR_flag ? 1 : 0);
                var modScriptURL = "";
 
                switch(modName) {'
                        ."\n".implode("\n", $moduleJavascriptCommands)."\n".'
                }
+               ';
 
-               var navFrames = {};';
-               foreach ($navFrameScripts as $mainMod => $frameScript) {
-                       $javascriptCode .= '
-               navFrames["'.$mainMod.'"] = "'.$frameScript.'";';
-               }
                $javascriptCode .= '
 
                if (!useCondensedMode && navFrames[mainModName]) {