[BUGFIX] Javascript for TMENU_LAYERS and GMENU_LAYERS missing 65/19265/3
authorMichael Stucki <michael.stucki@typo3.org>
Mon, 25 Mar 2013 11:56:14 +0000 (12:56 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 1 Apr 2013 09:39:17 +0000 (11:39 +0200)
If using TMENU_LAYERS/GMENU_LAYERS and (for example) indexed_search on
the same page, the JavaScript header tags are missing if the page is
loaded from the cache.

Resolves: #36719
Releases: 4.5, 4.6, 4.7, 6.0, 6.1
Change-Id: Icd52f68d2b9462360f0b9efd912d93d4b0c1048c
Reviewed-on: https://review.typo3.org/19265
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/cms/tslib/class.tslib_menu.php
typo3/sysext/cms/tslib/class.tslib_pagegen.php
typo3/sysext/statictemplates/media/scripts/gmenu_layers.php
typo3/sysext/statictemplates/media/scripts/tmenu_layers.php

index 8e0326c..1bde87b 100644 (file)
@@ -2935,7 +2935,7 @@ class tslib_jsmenu extends tslib_menu {
                        $JScode.= $this->generate_level($levels,1,$this->id,$this->menuArr,$this->MP_array).LF;
 
                        $GLOBALS['TSFE']->additionalHeaderData['JSMenuCode']='<script type="text/javascript" src="'.$GLOBALS['TSFE']->absRefPrefix.'t3lib/jsfunc.menu.js"></script>';
-                       $GLOBALS['TSFE']->JSCode.=$JScode;
+                       $GLOBALS['TSFE']->additionalJavaScript['JSCode'] .= $JScode;
 
                                // Printing:
                        $allFormCode="";
index 88397a4..e2b39d5 100644 (file)
@@ -146,7 +146,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
 
                if ($GLOBALS['TSFE']->type && $GLOBALS['TSFE']->config['config']['frameReloadIfNotInFrameset']) {
                        $tdlLD = $GLOBALS['TSFE']->tmpl->linkData($GLOBALS['TSFE']->page,'_top',$GLOBALS['TSFE']->no_cache,'');
-                       $GLOBALS['TSFE']->JSCode = 'if(!parent.'.trim($GLOBALS['TSFE']->sPre).' && !parent.view_frame) top.location.href="'.$GLOBALS['TSFE']->baseUrlWrap($tdlLD['totalURL']).'"';
+                       $GLOBALS['TSFE']->additionalJavaScript['JSCode'] .= 'if(!parent.'.trim($GLOBALS['TSFE']->sPre).' && !parent.view_frame) top.location.href="'.$GLOBALS['TSFE']->baseUrlWrap($tdlLD['totalURL']).'"';
                }
                $GLOBALS['TSFE']->compensateFieldWidth = ''.$GLOBALS['TSFE']->config['config']['compensateFieldWidth'];
                $GLOBALS['TSFE']->lockFilePath = ''.$GLOBALS['TSFE']->config['config']['lockFilePath'];
index af5f9b6..e0ea8f6 100644 (file)
@@ -354,7 +354,7 @@ if (!GLV_doReset["'.$mIdStr.'"] && GLV_currentLayer["'.$mIdStr.'"]!=null)   resetS
                }
                $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array_merge($this->WMtempStore,$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']);
                $GLOBALS['TSFE']->additionalHeaderData['gmenu_layer_shared']='<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath('cms').'tslib/media/scripts/jsfunc.layermenu.js"></script>';
-               $GLOBALS['TSFE']->JSCode.= '
+               $GLOBALS['TSFE']->additionalJavaScript['gmenu_layer_code'].= '
 
 GLV_curLayerWidth["'.$this->WMid.'"]=0;
 GLV_curLayerHeight["'.$this->WMid.'"]=0;
@@ -378,7 +378,7 @@ GLV_menuXY["'.$this->WMid.'"] = new Array();
 '.$this->WMrestoreVars;
 
                if ($this->mconf['freezeMouseover'])    {
-                       $GLOBALS['TSFE']->JSCode.= '
+                       $GLOBALS['TSFE']->additionalJavaScript['gmenu_layer_code'].= '
 // Alternative rollover/out functions for use with GMENU_LAYER
 function GL'.$this->WMid.'_over(mitm_id)       {
        GL'.$this->WMid.'_out("");      // removes any old roll over state of an item. Needed for alwaysKeep and Opera browsers.
@@ -395,7 +395,7 @@ function GL'.$this->WMid.'_out(mitm_id)     {
 }
 ';
                }
-               $GLOBALS["TSFE"]->JSCode.= '
+               $GLOBALS["TSFE"]->additionalJavaScript['gmenu_layer_code'].= '
 function GL'.$this->WMid.'_getMouse(e) {
        if (GLV_menuOn["'.$this->WMid.'"]!=null && !GLV_dontFollowMouse["'.$this->WMid.'"]){
 '.implode(LF,$GLV_menuOn).'
index b871120..d732969 100644 (file)
@@ -354,7 +354,7 @@ if (!GLV_doReset["'.$mIdStr.'"] && GLV_currentLayer["'.$mIdStr.'"]!=null)   resetS
                }
                $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array_merge($this->WMtempStore,$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']);
                $GLOBALS['TSFE']->additionalHeaderData['gmenu_layer_shared']='<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath('cms').'tslib/media/scripts/jsfunc.layermenu.js"></script>';
-               $GLOBALS['TSFE']->JSCode.= '
+               $GLOBALS['TSFE']->additionalJavaScript['gmenu_layer_code'].= '
 
 GLV_curLayerWidth["'.$this->WMid.'"]=0;
 GLV_curLayerHeight["'.$this->WMid.'"]=0;
@@ -378,7 +378,7 @@ GLV_menuXY["'.$this->WMid.'"] = new Array();
 '.$this->WMrestoreVars;
 
                if ($this->mconf['freezeMouseover'])    {
-                       $GLOBALS['TSFE']->JSCode.= '
+                       $GLOBALS['TSFE']->additionalJavaScript['gmenu_layer_code'].= '
 // Alternative rollover/out functions for use with GMENU_LAYER
 function GL'.$this->WMid.'_over(mitm_id)       {
        GL'.$this->WMid.'_out("");      // removes any old roll over state of an item. Needed for alwaysKeep and Opera browsers.
@@ -395,7 +395,7 @@ function GL'.$this->WMid.'_out(mitm_id)     {
 }
 ';
                }
-               $GLOBALS["TSFE"]->JSCode.= '
+               $GLOBALS["TSFE"]->additionalJavaScript['gmenu_layer_code'].= '
 function GL'.$this->WMid.'_getMouse(e) {
        if (GLV_menuOn["'.$this->WMid.'"]!=null && !GLV_dontFollowMouse["'.$this->WMid.'"]){
 '.implode(LF,$GLV_menuOn).'