[BUGFIX] Remove redundant layermenu files 61/19261/4
authorMichael Stucki <michael.stucki@typo3.org>
Mon, 25 Mar 2013 12:36:35 +0000 (13:36 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 1 Apr 2013 11:02:33 +0000 (13:02 +0200)
These files were maintained as two individual version. A number of
bugfixes were only applied in one version bot not in the other.

This change adds all missing fixes to the files in "statictemplates" and
removes all code from the files in "cms".

Resolves: #46644
Releases: 4.5, 4.7
Change-Id: I56ce401c73933eda381ce52b4d906a12b6ed963c
Reviewed-on: https://review.typo3.org/19261
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/cms/tslib/media/scripts/gmenu_layers.php
typo3/sysext/cms/tslib/media/scripts/tmenu_layers.php
typo3/sysext/cms/tslib/media/scripts/xmenu_layers.diff [deleted file]
typo3/sysext/statictemplates/media/scripts/gmenu_layers.php
typo3/sysext/statictemplates/media/scripts/tmenu_layers.php
typo3/sysext/statictemplates/media/scripts/xmenu_layers.diff

index 56ead78..acd3a0b 100644 (file)
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
-/**
- * Contains the GMENU_LAYERS extension class, tslib_gmenu_layers
- *
- * $Id$
- * Revised for TYPO3 3.6 June/2003 by Kasper Skårhøj
- * XHTML compliant
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- *   84: class tslib_gmenu_layers extends tslib_gmenu
- *  116:     function extProc_init()
- *  134:     function extProc_RO($key)
- *  150:     function extProc_beforeLinking($key)
- *  205:     function extProc_afterLinking($key)
- *  240:     function extProc_beforeAllWrap($item,$key)
- *  253:     function isSetIntval($in)
- *  262:     function extProc_finish ()
- *  444:     function extCalcBorderWithin($kind,$integer)
- *
- * TOTAL FUNCTIONS: 8
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
-
-
-
-
-
-
-
-
-
-
-
-
-
 
-
-
-
-
-
-/**
- * Class extending tslib_gmenu for the creation of DHTML menus
- * NOTICE: The contents of this class is made so that it can be copied EXACTLY AS IS to the tmenu_layers class! See notes in class (for BEGIN/END) and also "diff.xmenu_layers.txt"
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage tslib
- * @see diff.xmenu_layers.txt
+/*
+ * This file was moved long time ago, but the original file remained as a copy.
+ * Therefore, use the new version if this file is loaded.
  */
-class tslib_gmenu_layers extends tslib_gmenu {
-
-// FULL DUPLICATE TO tmenu_layers BEGIN:
-
-       var $GMENU_fixKey='layers';
-       var $divLayers=Array();
-
-       var $WMx=0;
-       var $WMy=0;
-       var $WMxyArray=array();
-       var $WMextraScript='';
-       var $WMlastKey='';
-       var $WMrestoreScript='';
-       var $WMresetSubMenus='';
-       var $WMactiveHasSubMenu='';
-       var $WMactiveKey='';
-       var $WMtheSubMenu;
-       var $WMisSub;
-       var $WMhideCode;
-       var $WMonlyOnLoad=0;
-       var $WMbordersWithin=array();
-       var $WMsubIds=array();
-       var $WMtempStore=array();
-       var $WMlockPosition_addAccumulated=array();
-       var $VMmouseoverActions=array();
-       var $VMmouseoutActions=array();
-
-       /**
-        * Creating unique menu id string plus other initialization of internal variables (all prefixed "WM")
-        *
-        * @return      void
-        */
-       function extProc_init() {
-               $this->WMid = trim($this->mconf['layer_menu_id']) ? trim($this->mconf['layer_menu_id']) . 'x' : substr(md5('gl' . serialize($this->mconf)), 0, 6);
-
-               $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'][]=$this->WMid;
-               $this->WMtempStore = $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'];
-               $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array();
-
-                       // Save:
-               $this->WMonlyOnLoad = ($this->mconf['displayActiveOnLoad'] && !$this->mconf['displayActiveOnLoad.']['onlyOnLoad']);
-               $this->WMbordersWithin = t3lib_div::intExplode(',',$this->mconf['bordersWithin'].',0,0,0,0,0');
-       }
-
-       /**
-        * Processing of mouse-over features depending on whether "freezeMouseover" property is set.
-        *
-        * @param       integer         Pointer to $this->menuArr[$key] where the current menu element record is found OR $this->result['RO'][$key] where the configuration for that elements RO version is found! Here it is used with the ->WMid to make unique names
-        * @return      void
-        */
-       function extProc_RO($key)       {
-               if ($this->mconf['freezeMouseover'])    {
-                       $this->VMmouseoverActions[$this->WMid.$key]='case "Menu'.$this->WMid.$key.'":'.$this->I['linkHREF']['onMouseover'].'; break;';
-                       $this->VMmouseoutActions[$this->WMid.$key]='case "Menu'.$this->WMid.$key.'":'.$this->I['linkHREF']['onMouseout'].'; break;';
-                       $this->I['linkHREF']['onMouseover']='GL'.$this->WMid.'_over(\'Menu'.$this->WMid.$key.'\');';
-                       $this->I['linkHREF']['onMouseout']='';
-               }
-       }
-
-       /**
-        * Processing before the links are created.
-        * This means primarily creating some javaScript code for the management.
-        *
-        * @param       integer         Pointer to $this->menuArr[$key] where the current menu element record is found
-        * @return      void
-        */
-       function extProc_beforeLinking($key)    {
-               if ($this->I['uid'])    {
-
-                       array_push($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId'],$this->WMid);
-                       $this->WMtheSubMenu = $this->subMenu($this->I['uid'], $this->WMsubmenuObjSuffixes[$key]['sOSuffix']);
-                       array_pop($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId']);
-                       $this->WMisSub = trim($this->WMtheSubMenu) ? 1 : 0;
-
-                       if ($this->mconf['lockPosition_addSelf'])               {
-                               $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']);
-                               $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']);
-                       }
-
-                       if ($this->isActive($this->I['uid'], $this->getMPvar($key)) && $this->mconf['displayActiveOnLoad'])     {       // orig: && $this->WMisSub, changed 210901
-                               $this->WMactiveHasSubMenu = $this->WMisSub;
-                               $this->WMactiveKey = 'Menu'.$this->WMid.$key;
-
-
-                               $this->WMrestoreVars=trim('
-GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
-                               ');
-                               $this->WMrestoreScript='        GL_doTop("'.$this->WMid.'",GLV_restoreMenu["'.$this->WMid.'"]);'.($this->mconf['freezeMouseover']?'
-       GL'.$this->WMid.'_over(GLV_restoreMenu["'.$this->WMid.'"]);
-':'');
-                       }
-
-                       if ($this->WMisSub)     {
-                               $event="GL_stopMove('".$this->WMid."');";
-                               $this->I['linkHREF']['onMouseover']='GL_doTop(\''.$this->WMid.'\', \'Menu'.$this->WMid.$key.'\');'.$this->I['linkHREF']['onMouseover'];
-                                       // IESelectFix - Activates IFRAME layer below menu
-                               if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover']=$this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'Menu'.$this->WMid.$key.'\',true);';
-                                       // Added 120802; This means that everytime leaving a menuitem the layer should be shut down (and if the layer is hit in the meantime it is not though).
-                                       // This should happen only for items that are auto-hidden when not over and possibly only when a hide-timer is set. Problem is if the hide-timer is not set and we leave the main element, then the layer will be hidden unless we reach the layer before the timeout will happen and the menu hidden.
-                               if (t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])  {
-                                       $event.='GL_resetAll("'.$this->WMid.'");';
-                               }
-                               $this->I['linkHREF']['onMouseout'].=$event;
-                       } else {
-                               $this->I['linkHREF']['onMouseover'] = 'GL_hideAll("'.$this->WMid.'");'.$this->I['linkHREF']['onMouseover'];
-                                       // IESelectFix - Hides IFRAME layer below menu
-                               if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover'] = $this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'\',false);';
-                               $event='GL_resetAll("'.$this->WMid.'");';
-                               $this->I['linkHREF']['onMouseout'].=$event;
-                       }
-
-                       $this->WMxyArray[] = 'GLV_menuXY["'.$this->WMid.'"]["Menu'.$this->WMid.$key.'"] = new Array('.$this->WMx.','.$this->WMy.',"itemID'.t3lib_div::shortmd5($this->I['uid'].'-'.$this->WMid).'","anchorID'.t3lib_div::shortmd5($this->I['uid'].'-'.$this->WMid).'");';
-               }
-       }
-
-       /**
-        * Processing after linking, basically setting the <div>-layers for the menu items. Also some more JavaScript code is made.
-        *
-        * @param       integer         Pointer to $this->menuArr[$key] where the current menu element record is found
-        * @return      void
-        */
-       function extProc_afterLinking($key)     {
-               if ($this->I['uid'])    {
-                       if (!$this->I['spacer'] && $this->WMisSub)      {
-                               $exStyle=$this->mconf['layerStyle'] ? $this->mconf['layerStyle'] : 'position:absolute;visibility:hidden';
-                               if (trim($exStyle))     {
-                                       $exStyle=' '.$exStyle;
-                               }
-                               $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['layerCounter']++;
-                               $zIndex = 10000-$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['layerCounter'];
-#                              $zIndex = (($key+2)*$this->menuNumber*100);
-                               $divStart = '<div id="Menu'.$this->WMid.$key.'" style="z-index:'.$zIndex.';'.$exStyle.'">';
-                               $divStop = '</div>';
-
-                               $this->divLayers[]= $divStart.$this->WMtheSubMenu.$divStop;
-
-                               $this->WMhideCode.='
-       GL_getObjCss("Menu'.$this->WMid.$key.'").visibility = "hidden";';
-                               $this->WMlastKey = 'Menu'.$this->WMid.$key;
-                       }
-
-                       if (!$this->mconf['lockPosition_addSelf'])              {
-                               $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']);
-                               $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']);
-                       }
-               }
-               $this->WMresult.=$this->I['theItem'];
-       }
-
-       /**
-        * Wrapping the item in a <div> section if 'relativeToTriggerItem' was set
-        *
-        * @param       string          The current content of the menu item, $this->I['theItem'], passed along.
-        * @param       integer         Pointer to $this->menuArr[$key] where the current menu element record is found
-        * @return      string          The modified version of $item, going back into $this->I['theItem']
-        */
-       function extProc_beforeAllWrap($item,$key)      {
-               if ($this->mconf['relativeToTriggerItem'])      {
-                       $item = '<div id="anchorID'.t3lib_div::shortmd5($this->I['uid'].'-'.$this->WMid).'" style="position:absolute;visibility:hidden;"></div><div id="itemID'.t3lib_div::shortmd5($this->I['uid'].'-'.$this->WMid).'" style="width:100%; height:100%;">'.$item.'</div>';
-               }
-               return $item;
-       }
-
-       /**
-        * Returns true if different from ''  OR if intval()!=0
-        *
-        * @param       string          Value to evaluate
-        * @return      boolean         true if $in is different from ''  OR if intval()!=0
-        */
-       function isSetIntval($in)       {
-               return $this->mconf['blankStrEqFalse'] ? strcmp($in,'') : intval($in);
-       }
-
-       /**
-        * Putting things together, in particular the JavaScript code needed for the DHTML menu.
-        *
-        * @return      mixed           Returns the value of a call to the parent function, parent::extProc_finish();
-        */
-       function extProc_finish ()      {
-               $dirL = $this->mconf['directionLeft'] ? '-GL_getObj(id).width' : '';
-               $dirU = $this->mconf['directionUp'] ? '-GL_getObj(id).height' : '';
-
-               $parentLayerId = end($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId']);
-
-               $DoTop=array();
-               $GLV_menuOn=array();
-               $relCode=array();
-               $relFlag=0;
-               if ($this->mconf['relativeToParentLayer'] && $parentLayerId)    {
-                       $relCode['X'].='GLV_curLayerX["'.$parentLayerId.'"]+';
-                       $relCode['Y'].='GLV_curLayerY["'.$parentLayerId.'"]+';
-                       if ($this->mconf['relativeToParentLayer.']['addWidth'])         {       $relCode['X'].='GLV_curLayerWidth["'.$parentLayerId.'"]+';      }
-                       if ($this->mconf['relativeToParentLayer.']['addHeight'])        {       $relCode['Y'].='GLV_curLayerHeight["'.$parentLayerId.'"]+';     }
-               }
-               if ($this->mconf['relativeToTriggerItem'])      {
-                       $DoTop[]='
-               var parentObject = GL_getObj(GLV_menuXY[WMid][id][2]);
-               var TI_width = parentObject.width;
-               var TI_height = parentObject.height;
-               var anchorObj = GL_getObj(GLV_menuXY[WMid][id][3]);
-               var TI_x = anchorObj.x;
-               var TI_y = anchorObj.y;
-                       ';
-                       $relCode['X'].='TI_x+';
-                       $relCode['Y'].='TI_y+';
-
-                       if ($this->mconf['relativeToTriggerItem.']['addWidth']) {       $relCode['X'].='TI_width+';     }
-                       if ($this->mconf['relativeToTriggerItem.']['addHeight'])        {       $relCode['Y'].='TI_height+';    }
-                       $relFlag=1;
-               }
-               if ($relFlag)   {
-                       $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";';
-                       $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top =  ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";';
-               } else {
-                               // X position (y is fixed)
-                       if (!strcmp($this->mconf['lockPosition'],'x'))  {
-                               $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].'GLV_menuXY["'.$this->WMid.'"][id][0]-('.intval($this->mconf['xPosOffset']).')'.$dirL.')+"px";';
-                               if ($this->isSetIntval($this->mconf['topOffset']))      {
-                                       $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";';
-                               }
-                       } elseif ($this->isSetIntval($this->mconf['xPosOffset'])) {
-                               $GLV_menuOn[]=$DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = (GLV_x-('.intval($this->mconf['xPosOffset']).')'.$dirL.')+"px";';
-                               if ($this->isSetIntval($this->mconf['topOffset']))      {
-                                       $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";';
-                               }
-                       }
-                               // Y position   (x is fixed)
-                       if (!strcmp($this->mconf['lockPosition'],'y'))  {
-                               $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].'GLV_menuXY["'.$this->WMid.'"][id][1]-('.intval($this->mconf['yPosOffset']).')'.$dirU.')+"px";';
-                               if ($this->isSetIntval($this->mconf['leftOffset']))     {
-                                       $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";';
-                               }
-                       } elseif ($this->isSetIntval($this->mconf['yPosOffset']))       {
-                               $GLV_menuOn[]=$DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = (GLV_y-('.intval($this->mconf['yPosOffset']).')'.$dirU.')+"px";';
-                               if ($this->isSetIntval($this->mconf['leftOffset']))     {
-                                       $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";';
-                               }
-                       }
-               }
-
-                       // BordersWithIn:
-               $DoTop[]=$this->extCalcBorderWithin('left',$this->WMbordersWithin[0]);
-               $DoTop[]=$this->extCalcBorderWithin('top',$this->WMbordersWithin[1]);
-               $DoTop[]=$this->extCalcBorderWithin('right',$this->WMbordersWithin[2]);
-               $DoTop[]=$this->extCalcBorderWithin('bottom',$this->WMbordersWithin[3]);
-               $DoTop[]=$this->extCalcBorderWithin('left',$this->WMbordersWithin[4]);
-               $DoTop[]=$this->extCalcBorderWithin('top',$this->WMbordersWithin[5]);
-
-
-               if ($this->mconf['freezeMouseover'] && !$this->mconf['freezeMouseover.']['alwaysKeep']) {
-                       $this->WMhideCode.='
-GL'.$this->WMid.'_out("");';
-               }
-
-               $TEST='';
-               if (count($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']))   {
-                       foreach ($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'] as $mIdStr) {
-                               $this->WMhideCode.='
-GL_hideAll("'.$mIdStr.'");';
-                               $this->WMrestoreScript.='
-GL_restoreMenu("'.$mIdStr.'");';
-                               $this->WMresetSubMenus.='
-if (!GLV_doReset["'.$mIdStr.'"] && GLV_currentLayer["'.$mIdStr.'"]!=null)      resetSubMenu=0;';
-                       }
-               }
-                       // IESelectFix - Adds IFRAME tag to HTML, Hides IFRAME layer below menu
-               if ($this->mconf['ieSelectFix']) {
-                       $this->WMhideCode.= '
-       GL_iframer(\''.$this->WMid.'\',\'\',false);';
-                       $this->divLayers['iframe'] = '<iframe id="Iframe'.$this->WMid.'" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; background-color:transparent; layer-background-color:transparent; display:none;"></iframe>';
-               }
-               $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.= '
-
-GLV_curLayerWidth["'.$this->WMid.'"]=0;
-GLV_curLayerHeight["'.$this->WMid.'"]=0;
-GLV_curLayerX["'.$this->WMid.'"]=0;
-GLV_curLayerY["'.$this->WMid.'"]=0;
-GLV_menuOn["'.$this->WMid.'"] = null;
-GLV_gap["'.$this->WMid.'"]='.t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600).';
-GLV_currentLayer["'.$this->WMid.'"] = null;
-GLV_currentROitem["'.$this->WMid.'"] = null;
-GLV_hasBeenOver["'.$this->WMid.'"]=0;
-GLV_doReset["'.$this->WMid.'"]=false;
-GLV_lastKey["'.$this->WMid.'"] = "'.$this->WMlastKey.'";
-GLV_onlyOnLoad["'.$this->WMid.'"] = '.($this->WMonlyOnLoad?1:0).';
-GLV_dontHideOnMouseUp["'.$this->WMid.'"] = '.($this->mconf['dontHideOnMouseUp']?1:0).';
-GLV_dontFollowMouse["'.$this->WMid.'"] = '.($this->mconf['dontFollowMouse']?1:0).';
-GLV_date = new Date();
-GLV_timeout["'.$this->WMid.'"] = GLV_date.getTime();
-GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_div::intInRange($this->mconf['hideMenuTimer'],0,20000).';
-GLV_menuXY["'.$this->WMid.'"] = new Array();
-'.implode(LF,$this->WMxyArray).'
-'.$this->WMrestoreVars;
-
-               if ($this->mconf['freezeMouseover'])    {
-                       $GLOBALS['TSFE']->JSCode.= '
-// 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.
-       switch(mitm_id) {
-'.implode(LF,$this->VMmouseoverActions).'
-       }
-       GLV_currentROitem["'.$this->WMid.'"]=mitm_id;
-}
-function GL'.$this->WMid.'_out(mitm_id)        {
-       if (!mitm_id)   mitm_id=GLV_currentROitem["'.$this->WMid.'"];
-       switch(mitm_id) {
-'.implode(LF,$this->VMmouseoutActions).'
-       }
-}
-';
-               }
-               $GLOBALS["TSFE"]->JSCode.= '
-function GL'.$this->WMid.'_getMouse(e) {
-       if (GLV_menuOn["'.$this->WMid.'"]!=null && !GLV_dontFollowMouse["'.$this->WMid.'"]){
-'.implode(LF,$GLV_menuOn).'
-       }
-       GL_mouseMoveEvaluate("'.$this->WMid.'");
-}
-function GL'.$this->WMid.'_hideCode() {
-'.$this->WMhideCode.'
-}
-function GL'.$this->WMid.'_doTop(WMid,id) {
-'.trim(implode(LF,$DoTop)).'
-}
-function GL'.$this->WMid.'_restoreMenu() {
-'.$this->WMrestoreScript.'
-}
-function GL'.$this->WMid.'_resetSubMenus() {
-       var resetSubMenu=1;
-'.$this->WMresetSubMenus.'
-       return resetSubMenu;
-}
-
-GLV_timeout_pointers[GLV_timeout_count] = "'.$this->WMid.'";
-GLV_timeout_count++;
-
-';
-               $GLOBALS['TSFE']->JSeventFuncCalls['onload']['GL_initLayers()']= 'GL_initLayers();';
-               $GLOBALS['TSFE']->JSeventFuncCalls['onload'][$this->WMid]=      'GL_restoreMenu("'.$this->WMid.'");';
-               // Should be called BEFORE any of the 'local' getMouse functions!
-               // is put inside in a try catch block to avoid JS errors in IE
-               $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']['GL_getMouse(e)']= 'try{GL_getMouse(e);}catch(ex){};';
-               $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove'][$this->WMid]= 'try{GL'.$this->WMid.'_getMouse(e);}catch(ex){};';
-               $GLOBALS['TSFE']->JSeventFuncCalls['onmouseup'][$this->WMid]= 'GL_mouseUp(\''.$this->WMid.'\',e);';
-
-               $GLOBALS['TSFE']->divSection.=implode($this->divLayers,LF).LF;
-
-               return parent::extProc_finish();
-       }
-
-       /**
-        * Creates a JavaScript line which corrects the position of the layer based on the constraints in TypoScript property 'bordersWithin'
-        *
-        * @param       string          Direction to test.
-        * @param       integer         The boundary limit in the direction set by $kind. If set then a value is returned, otherwise blank.
-        * @return      string          JavaScript string for correction of the layer position (if $integer is true)
-        * @see extProc_finish(), extProc_init()
-        */
-       function extCalcBorderWithin($kind,$integer)    {
-               if ($integer)   {
-                       switch($kind)   {
-                               case 'right':
-                               case 'bottom':
-                                       $add='';
-                                       if ($kind=='right')             {$add='GL_getObj(id).width'; $key = 'left';}
-                                       if ($kind=='bottom')    {$add='GL_getObj(id).height'; $key = 'top';}
-                                       $str = 'if (parseInt(GLV_menuOn["'.$this->WMid.'"].'.$key.')+'.$add.'>'.$integer.') GLV_menuOn["'.$this->WMid.'"].'.$key.'='.$integer.'-'.$add.';';
-                               break;
-                               default:
-                                       $str = 'if (parseInt(GLV_menuOn["'.$this->WMid.'"].'.$kind.')<'.$integer.') GLV_menuOn["'.$this->WMid.'"].'.$kind.'='.$integer.';';
-                               break;
-                       }
-               }
-               return $str;
-       }
-}
-
-// FULL DUPLICATE TO tmenu_layers END:
-
-
-$GLOBALS['TSFE']->tmpl->menuclasses.=',gmenu_layers';
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/gmenu_layers.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/gmenu_layers.php']);
-}
+require_once(PATH_site . 'typo3/sysext/statictemplates/media/scripts/gmenu_layers.php');
 
 ?>
\ No newline at end of file
index f8f092b..07e044e 100644 (file)
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
-/**
- * Contains the TMENU_LAYERS extension class, tslib_tmenu_layers
- *
- * $Id$
- * Revised for TYPO3 3.6 June/2003 by Kasper Skårhøj
- * XHTML compliant
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- *   84: class tslib_tmenu_layers extends tslib_tmenu
- *  116:     function extProc_init()
- *  134:     function extProc_RO($key)
- *  150:     function extProc_beforeLinking($key)
- *  205:     function extProc_afterLinking($key)
- *  240:     function extProc_beforeAllWrap($item,$key)
- *  253:     function isSetIntval($in)
- *  262:     function extProc_finish ()
- *  444:     function extCalcBorderWithin($kind,$integer)
- *
- * TOTAL FUNCTIONS: 8
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
-
-
-
-
-
-
-
-
-
-
-
-
-
 
-
-
-
-
-
-/**
- * Class extending tslib_tmenu for the creation of text based DHTML menus
- * NOTICE: The contents of this class is copied EXACTLY AS IS from gmenu_layers class! See notes in class (for BEGIN/END) and also 'diff.xmenu_layers.txt'
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage tslib
- * @see diff.xmenu_layers.txt
+/*
+ * This file was moved long time ago, but the original file remained as a copy.
+ * Therefore, use the new version if this file is loaded.
  */
-class tslib_tmenu_layers extends tslib_tmenu {
-
-// FULL DUPLICATE FROM gmenu_layers BEGIN:
-
-       var $GMENU_fixKey='layers';
-       var $divLayers=Array();
-
-       var $WMx=0;
-       var $WMy=0;
-       var $WMxyArray=array();
-       var $WMextraScript='';
-       var $WMlastKey='';
-       var $WMrestoreScript='';
-       var $WMresetSubMenus='';
-       var $WMactiveHasSubMenu='';
-       var $WMactiveKey='';
-       var $WMtheSubMenu;
-       var $WMisSub;
-       var $WMhideCode;
-       var $WMonlyOnLoad=0;
-       var $WMbordersWithin=array();
-       var $WMsubIds=array();
-       var $WMtempStore=array();
-       var $WMlockPosition_addAccumulated=array();
-       var $VMmouseoverActions=array();
-       var $VMmouseoutActions=array();
-
-       /**
-        * Creating unique menu id string plus other initialization of internal variables (all prefixed "WM")
-        *
-        * @return      void
-        */
-       function extProc_init() {
-               $this->WMid = trim($this->mconf['layer_menu_id']) ? trim($this->mconf['layer_menu_id']) . 'x' : substr(md5('gl' . serialize($this->mconf)), 0, 6);
-
-               $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'][]=$this->WMid;
-               $this->WMtempStore = $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'];
-               $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array();
-
-                       // Save:
-               $this->WMonlyOnLoad = ($this->mconf['displayActiveOnLoad'] && !$this->mconf['displayActiveOnLoad.']['onlyOnLoad']);
-               $this->WMbordersWithin = t3lib_div::intExplode(',',$this->mconf['bordersWithin'].',0,0,0,0,0');
-       }
-
-       /**
-        * Processing of mouse-over features depending on whether "freezeMouseover" property is set.
-        *
-        * @param       integer         Pointer to $this->menuArr[$key] where the current menu element record is found OR $this->result['RO'][$key] where the configuration for that elements RO version is found! Here it is used with the ->WMid to make unique names
-        * @return      void
-        */
-       function extProc_RO($key)       {
-               if ($this->mconf['freezeMouseover'])    {
-                       $this->VMmouseoverActions[$this->WMid.$key]='case "Menu'.$this->WMid.$key.'":'.$this->I['linkHREF']['onMouseover'].'; break;';
-                       $this->VMmouseoutActions[$this->WMid.$key]='case "Menu'.$this->WMid.$key.'":'.$this->I['linkHREF']['onMouseout'].'; break;';
-                       $this->I['linkHREF']['onMouseover']='GL'.$this->WMid.'_over(\'Menu'.$this->WMid.$key.'\');';
-                       $this->I['linkHREF']['onMouseout']='';
-               }
-       }
-
-       /**
-        * Processing before the links are created.
-        * This means primarily creating some javaScript code for the management.
-        *
-        * @param       integer         Pointer to $this->menuArr[$key] where the current menu element record is found
-        * @return      void
-        */
-       function extProc_beforeLinking($key)    {
-               if ($this->I['uid'])    {
-
-                       array_push($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId'],$this->WMid);
-                       $this->WMtheSubMenu = $this->subMenu($this->I['uid'], $this->WMsubmenuObjSuffixes[$key]['sOSuffix']);
-                       array_pop($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId']);
-                       $this->WMisSub = trim($this->WMtheSubMenu) ? 1 : 0;
-
-                       if ($this->mconf['lockPosition_addSelf'])               {
-                               $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']);
-                               $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']);
-                       }
-
-                       if ($this->isActive($this->I['uid'], $this->getMPvar($key)) && $this->mconf['displayActiveOnLoad'])     {       // orig: && $this->WMisSub, changed 210901
-                               $this->WMactiveHasSubMenu = $this->WMisSub;
-                               $this->WMactiveKey = 'Menu'.$this->WMid.$key;
-
-
-                               $this->WMrestoreVars=trim('
-GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
-                               ');
-                               $this->WMrestoreScript='        GL_doTop("'.$this->WMid.'",GLV_restoreMenu["'.$this->WMid.'"]);'.($this->mconf['freezeMouseover']?'
-       GL'.$this->WMid.'_over(GLV_restoreMenu["'.$this->WMid.'"]);
-':'');
-                       }
-
-                       if ($this->WMisSub)     {
-                               $event="GL_stopMove('".$this->WMid."');";
-                               $this->I['linkHREF']['onMouseover']='GL_doTop(\''.$this->WMid.'\', \'Menu'.$this->WMid.$key.'\');'.$this->I['linkHREF']['onMouseover'];
-                                       // IESelectFix - Activates IFRAME layer below menu
-                               if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover']=$this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'Menu'.$this->WMid.$key.'\',true);';
-                                       // Added 120802; This means that everytime leaving a menuitem the layer should be shut down (and if the layer is hit in the meantime it is not though).
-                                       // This should happen only for items that are auto-hidden when not over and possibly only when a hide-timer is set. Problem is if the hide-timer is not set and we leave the main element, then the layer will be hidden unless we reach the layer before the timeout will happen and the menu hidden.
-                               if (t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])  {
-                                       $event.='GL_resetAll("'.$this->WMid.'");';
-                               }
-                               $this->I['linkHREF']['onMouseout'].=$event;
-                       } else {
-                               $this->I['linkHREF']['onMouseover'] = 'GL_hideAll("'.$this->WMid.'");'.$this->I['linkHREF']['onMouseover'];
-                                       // IESelectFix - Hides IFRAME layer below menu
-                               if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover'] = $this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'\',false);';
-                               $event='GL_resetAll("'.$this->WMid.'");';
-                               $this->I['linkHREF']['onMouseout'].=$event;
-                       }
-
-                       $this->WMxyArray[] = 'GLV_menuXY["'.$this->WMid.'"]["Menu'.$this->WMid.$key.'"] = new Array('.$this->WMx.','.$this->WMy.',"itemID'.t3lib_div::shortmd5($this->I['uid'].'-'.$this->WMid).'","anchorID'.t3lib_div::shortmd5($this->I['uid'].'-'.$this->WMid).'");';
-               }
-       }
-
-       /**
-        * Processing after linking, basically setting the <div>-layers for the menu items. Also some more JavaScript code is made.
-        *
-        * @param       integer         Pointer to $this->menuArr[$key] where the current menu element record is found
-        * @return      void
-        */
-       function extProc_afterLinking($key)     {
-               if ($this->I['uid'])    {
-                       if (!$this->I['spacer'] && $this->WMisSub)      {
-                               $exStyle=$this->mconf['layerStyle'] ? $this->mconf['layerStyle'] : 'position:absolute;visibility:hidden';
-                               if (trim($exStyle))     {
-                                       $exStyle=' '.$exStyle;
-                               }
-                               $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['layerCounter']++;
-                               $zIndex = 10000-$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['layerCounter'];
-#                              $zIndex = (($key+2)*$this->menuNumber*100);
-                               $divStart = '<div id="Menu'.$this->WMid.$key.'" style="z-index:'.$zIndex.';'.$exStyle.'">';
-                               $divStop = '</div>';
-
-                               $this->divLayers[]= $divStart.$this->WMtheSubMenu.$divStop;
-
-                               $this->WMhideCode.='
-       GL_getObjCss("Menu'.$this->WMid.$key.'").visibility = "hidden";';
-                               $this->WMlastKey = 'Menu'.$this->WMid.$key;
-                       }
-
-                       if (!$this->mconf['lockPosition_addSelf'])              {
-                               $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']);
-                               $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']);
-                       }
-               }
-               $this->WMresult.=$this->I['theItem'];
-       }
-
-       /**
-        * Wrapping the item in a <div> section if 'relativeToTriggerItem' was set
-        *
-        * @param       string          The current content of the menu item, $this->I['theItem'], passed along.
-        * @param       integer         Pointer to $this->menuArr[$key] where the current menu element record is found
-        * @return      string          The modified version of $item, going back into $this->I['theItem']
-        */
-       function extProc_beforeAllWrap($item,$key)      {
-               if ($this->mconf['relativeToTriggerItem'])      {
-                       $item = '<div id="anchorID'.t3lib_div::shortmd5($this->I['uid'].'-'.$this->WMid).'" style="position:absolute;visibility:hidden;"></div><div id="itemID'.t3lib_div::shortmd5($this->I['uid'].'-'.$this->WMid).'" style="width:100%; height:100%;">'.$item.'</div>';
-               }
-               return $item;
-       }
-
-       /**
-        * Returns true if different from ''  OR if intval()!=0
-        *
-        * @param       string          Value to evaluate
-        * @return      boolean         true if $in is different from ''  OR if intval()!=0
-        */
-       function isSetIntval($in)       {
-               return $this->mconf['blankStrEqFalse'] ? strcmp($in,'') : intval($in);
-       }
-
-       /**
-        * Putting things together, in particular the JavaScript code needed for the DHTML menu.
-        *
-        * @return      mixed           Returns the value of a call to the parent function, parent::extProc_finish();
-        */
-       function extProc_finish ()      {
-               $dirL = $this->mconf['directionLeft'] ? '-GL_getObj(id).width' : '';
-               $dirU = $this->mconf['directionUp'] ? '-GL_getObj(id).height' : '';
-
-               $parentLayerId = end($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId']);
-
-               $DoTop=array();
-               $GLV_menuOn=array();
-               $relCode=array();
-               $relFlag=0;
-               if ($this->mconf['relativeToParentLayer'] && $parentLayerId)    {
-                       $relCode['X'].='GLV_curLayerX["'.$parentLayerId.'"]+';
-                       $relCode['Y'].='GLV_curLayerY["'.$parentLayerId.'"]+';
-                       if ($this->mconf['relativeToParentLayer.']['addWidth'])         {       $relCode['X'].='GLV_curLayerWidth["'.$parentLayerId.'"]+';      }
-                       if ($this->mconf['relativeToParentLayer.']['addHeight'])        {       $relCode['Y'].='GLV_curLayerHeight["'.$parentLayerId.'"]+';     }
-               }
-               if ($this->mconf['relativeToTriggerItem'])      {
-                       $DoTop[]='
-               var parentObject = GL_getObj(GLV_menuXY[WMid][id][2]);
-               var TI_width = parentObject.width;
-               var TI_height = parentObject.height;
-               var anchorObj = GL_getObj(GLV_menuXY[WMid][id][3]);
-               var TI_x = anchorObj.x;
-               var TI_y = anchorObj.y;
-                       ';
-                       $relCode['X'].='TI_x+';
-                       $relCode['Y'].='TI_y+';
-
-                       if ($this->mconf['relativeToTriggerItem.']['addWidth']) {       $relCode['X'].='TI_width+';     }
-                       if ($this->mconf['relativeToTriggerItem.']['addHeight'])        {       $relCode['Y'].='TI_height+';    }
-                       $relFlag=1;
-               }
-               if ($relFlag)   {
-                       $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";';
-                       $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top =  ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";';
-               } else {
-                               // X position (y is fixed)
-                       if (!strcmp($this->mconf['lockPosition'],'x'))  {
-                               $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].'GLV_menuXY["'.$this->WMid.'"][id][0]-('.intval($this->mconf['xPosOffset']).')'.$dirL.')+"px";';
-                               if ($this->isSetIntval($this->mconf['topOffset']))      {
-                                       $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";';
-                               }
-                       } elseif ($this->isSetIntval($this->mconf['xPosOffset'])) {
-                               $GLV_menuOn[]=$DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = (GLV_x-('.intval($this->mconf['xPosOffset']).')'.$dirL.')+"px";';
-                               if ($this->isSetIntval($this->mconf['topOffset']))      {
-                                       $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";';
-                               }
-                       }
-                               // Y position   (x is fixed)
-                       if (!strcmp($this->mconf['lockPosition'],'y'))  {
-                               $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].'GLV_menuXY["'.$this->WMid.'"][id][1]-('.intval($this->mconf['yPosOffset']).')'.$dirU.')+"px";';
-                               if ($this->isSetIntval($this->mconf['leftOffset']))     {
-                                       $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";';
-                               }
-                       } elseif ($this->isSetIntval($this->mconf['yPosOffset']))       {
-                               $GLV_menuOn[]=$DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = (GLV_y-('.intval($this->mconf['yPosOffset']).')'.$dirU.')+"px";';
-                               if ($this->isSetIntval($this->mconf['leftOffset']))     {
-                                       $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";';
-                               }
-                       }
-               }
-
-                       // BordersWithIn:
-               $DoTop[]=$this->extCalcBorderWithin('left',$this->WMbordersWithin[0]);
-               $DoTop[]=$this->extCalcBorderWithin('top',$this->WMbordersWithin[1]);
-               $DoTop[]=$this->extCalcBorderWithin('right',$this->WMbordersWithin[2]);
-               $DoTop[]=$this->extCalcBorderWithin('bottom',$this->WMbordersWithin[3]);
-               $DoTop[]=$this->extCalcBorderWithin('left',$this->WMbordersWithin[4]);
-               $DoTop[]=$this->extCalcBorderWithin('top',$this->WMbordersWithin[5]);
-
-
-               if ($this->mconf['freezeMouseover'] && !$this->mconf['freezeMouseover.']['alwaysKeep']) {
-                       $this->WMhideCode.='
-GL'.$this->WMid.'_out("");';
-               }
-
-               $TEST='';
-               if (count($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']))   {
-                       foreach ($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'] as $mIdStr) {
-                               $this->WMhideCode.='
-GL_hideAll("'.$mIdStr.'");';
-                               $this->WMrestoreScript.='
-GL_restoreMenu("'.$mIdStr.'");';
-                               $this->WMresetSubMenus.='
-if (!GLV_doReset["'.$mIdStr.'"] && GLV_currentLayer["'.$mIdStr.'"]!=null)      resetSubMenu=0;';
-                       }
-               }
-                       // IESelectFix - Adds IFRAME tag to HTML, Hides IFRAME layer below menu
-               if ($this->mconf['ieSelectFix']) {
-                       $this->WMhideCode.= '
-       GL_iframer(\''.$this->WMid.'\',\'\',false);';
-                       $this->divLayers['iframe'] = '<iframe id="Iframe'.$this->WMid.'" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; background-color:transparent; layer-background-color:transparent; display:none;"></iframe>';
-               }
-               $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.= '
-
-GLV_curLayerWidth["'.$this->WMid.'"]=0;
-GLV_curLayerHeight["'.$this->WMid.'"]=0;
-GLV_curLayerX["'.$this->WMid.'"]=0;
-GLV_curLayerY["'.$this->WMid.'"]=0;
-GLV_menuOn["'.$this->WMid.'"] = null;
-GLV_gap["'.$this->WMid.'"]='.t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600).';
-GLV_currentLayer["'.$this->WMid.'"] = null;
-GLV_currentROitem["'.$this->WMid.'"] = null;
-GLV_hasBeenOver["'.$this->WMid.'"]=0;
-GLV_doReset["'.$this->WMid.'"]=false;
-GLV_lastKey["'.$this->WMid.'"] = "'.$this->WMlastKey.'";
-GLV_onlyOnLoad["'.$this->WMid.'"] = '.($this->WMonlyOnLoad?1:0).';
-GLV_dontHideOnMouseUp["'.$this->WMid.'"] = '.($this->mconf['dontHideOnMouseUp']?1:0).';
-GLV_dontFollowMouse["'.$this->WMid.'"] = '.($this->mconf['dontFollowMouse']?1:0).';
-GLV_date = new Date();
-GLV_timeout["'.$this->WMid.'"] = GLV_date.getTime();
-GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_div::intInRange($this->mconf['hideMenuTimer'],0,20000).';
-GLV_menuXY["'.$this->WMid.'"] = new Array();
-'.implode(LF,$this->WMxyArray).'
-'.$this->WMrestoreVars;
-
-               if ($this->mconf['freezeMouseover'])    {
-                       $GLOBALS['TSFE']->JSCode.= '
-// 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.
-       switch(mitm_id) {
-'.implode(LF,$this->VMmouseoverActions).'
-       }
-       GLV_currentROitem["'.$this->WMid.'"]=mitm_id;
-}
-function GL'.$this->WMid.'_out(mitm_id)        {
-       if (!mitm_id)   mitm_id=GLV_currentROitem["'.$this->WMid.'"];
-       switch(mitm_id) {
-'.implode(LF,$this->VMmouseoutActions).'
-       }
-}
-';
-               }
-               $GLOBALS["TSFE"]->JSCode.= '
-function GL'.$this->WMid.'_getMouse(e) {
-       if (GLV_menuOn["'.$this->WMid.'"]!=null && !GLV_dontFollowMouse["'.$this->WMid.'"]){
-'.implode(LF,$GLV_menuOn).'
-       }
-       GL_mouseMoveEvaluate("'.$this->WMid.'");
-}
-function GL'.$this->WMid.'_hideCode() {
-'.$this->WMhideCode.'
-}
-function GL'.$this->WMid.'_doTop(WMid,id) {
-'.trim(implode(LF,$DoTop)).'
-}
-function GL'.$this->WMid.'_restoreMenu() {
-'.$this->WMrestoreScript.'
-}
-function GL'.$this->WMid.'_resetSubMenus() {
-       var resetSubMenu=1;
-'.$this->WMresetSubMenus.'
-       return resetSubMenu;
-}
-
-GLV_timeout_pointers[GLV_timeout_count] = "'.$this->WMid.'";
-GLV_timeout_count++;
-
-';
-               $GLOBALS['TSFE']->JSeventFuncCalls['onload']['GL_initLayers()']= 'GL_initLayers();';
-               $GLOBALS['TSFE']->JSeventFuncCalls['onload'][$this->WMid]=      'GL_restoreMenu("'.$this->WMid.'");';
-               // Should be called BEFORE any of the 'local' getMouse functions!
-               // is put inside in a try catch block to avoid JS errors in IE
-               $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']['GL_getMouse(e)']= 'try{GL_getMouse(e);}catch(ex){};';
-               $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove'][$this->WMid]= 'try{GL'.$this->WMid.'_getMouse(e);}catch(ex){};';
-               $GLOBALS['TSFE']->JSeventFuncCalls['onmouseup'][$this->WMid]= 'GL_mouseUp(\''.$this->WMid.'\',e);';
-
-               $GLOBALS['TSFE']->divSection.=implode($this->divLayers,LF).LF;
-
-               return parent::extProc_finish();
-       }
-
-       /**
-        * Creates a JavaScript line which corrects the position of the layer based on the constraints in TypoScript property 'bordersWithin'
-        *
-        * @param       string          Direction to test.
-        * @param       integer         The boundary limit in the direction set by $kind. If set then a value is returned, otherwise blank.
-        * @return      string          JavaScript string for correction of the layer position (if $integer is true)
-        * @see extProc_finish(), extProc_init()
-        */
-       function extCalcBorderWithin($kind,$integer)    {
-               if ($integer)   {
-                       switch($kind)   {
-                               case 'right':
-                               case 'bottom':
-                                       $add='';
-                                       if ($kind=='right')             {$add='GL_getObj(id).width'; $key = 'left';}
-                                       if ($kind=='bottom')    {$add='GL_getObj(id).height'; $key = 'top';}
-                                       $str = 'if (parseInt(GLV_menuOn["'.$this->WMid.'"].'.$key.')+'.$add.'>'.$integer.') GLV_menuOn["'.$this->WMid.'"].'.$key.'='.$integer.'-'.$add.';';
-                               break;
-                               default:
-                                       $str = 'if (parseInt(GLV_menuOn["'.$this->WMid.'"].'.$kind.')<'.$integer.') GLV_menuOn["'.$this->WMid.'"].'.$kind.'='.$integer.';';
-                               break;
-                       }
-               }
-               return $str;
-       }
-}
-
-// FULL DUPLICATE FROM gmenu_layers END:
-
-
-$GLOBALS['TSFE']->tmpl->menuclasses.=',tmenu_layers';
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/tmenu_layers.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/tmenu_layers.php']);
-}
+require_once(PATH_site . 'typo3/sysext/statictemplates/media/scripts/tmenu_layers.php');
 
 ?>
\ No newline at end of file
diff --git a/typo3/sysext/cms/tslib/media/scripts/xmenu_layers.diff b/typo3/sysext/cms/tslib/media/scripts/xmenu_layers.diff
deleted file mode 100755 (executable)
index e1c5716..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-# The files gmenu_layers and tmenu_layers should be exactly the same except
-# these differences:
---- gmenu_layers.php   2006-07-04 19:44:39.000000000 +0200
-+++ tmenu_layers.php   2006-07-04 19:44:39.000000000 +0200
-@@ -25,5 +25,5 @@
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
- /**
-- * Contains the GMENU_LAYERS extension class, tslib_gmenu_layers
-+ * Contains the TMENU_LAYERS extension class, tslib_tmenu_layers
-  *
-@@ -38,7 +38,7 @@
-  *
-  *
-  *
-- *   84: class tslib_gmenu_layers extends tslib_gmenu
-+ *   84: class tslib_tmenu_layers extends tslib_tmenu
-  *  116:     function extProc_init()
-  *  134:     function extProc_RO($key)
-  *  150:     function extProc_beforeLinking($key)
-@@ -72,8 +72,8 @@
- /**
-- * Class extending tslib_gmenu for the creation of DHTML menus
-- * NOTICE: The contents of this class is made so that it can be copied EXACTLY AS IS to the tmenu_layers class! See notes in class (for BEGIN/END) and also "diff.xmenu_layers.txt"
-+ * Class extending tslib_tmenu for the creation of text based DHTML menus
-+ * NOTICE: The contents of this class is copied EXACTLY AS IS from gmenu_layers class! See notes in class (for BEGIN/END) and also 'diff.xmenu_layers.txt'
-  *
-  * @author    Kasper Skaarhoj <kasperYYYY@typo3.com>
-  * @package TYPO3
-@@ -81,9 +81,9 @@
-  * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=385&cHash=648519dd66
-  * @see diff.xmenu_layers.txt
-  */
--class tslib_gmenu_layers extends tslib_gmenu {
-+class tslib_tmenu_layers extends tslib_tmenu {
--// FULL DUPLICATE TO tmenu_layers BEGIN:
-+// FULL DUPLICATE FROM gmenu_layers BEGIN:
-       var $GMENU_fixKey='layers';
-       var $divLayers=Array();
-@@ -460,13 +460,13 @@
-       }
- }
--// FULL DUPLICATE TO tmenu_layers END:
-+// FULL DUPLICATE FROM gmenu_layers END:
--$GLOBALS['TSFE']->tmpl->menuclasses.=',gmenu_layers';
-+$GLOBALS['TSFE']->tmpl->menuclasses.=',tmenu_layers';
--if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/gmenu_layers.php'])     {
--      include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/gmenu_layers.php']);
-+if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/tmenu_layers.php'])     {
-+      include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/tmenu_layers.php']);
- }
- ?>
index e0ea8f6..692702c 100644 (file)
@@ -27,7 +27,7 @@
 /**
  * Contains the GMENU_LAYERS extension class, tslib_gmenu_layers
  *
- * $Id: gmenu_layers.php 5165 2009-03-09 18:28:59Z ohader $
+ * $Id$
  * Revised for TYPO3 3.6 June/2003 by Kasper Skårhøj
  * XHTML compliant
  *
@@ -78,7 +78,6 @@
  * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage tslib
- * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=385&cHash=648519dd66
  * @see diff.xmenu_layers.txt
  */
 class tslib_gmenu_layers extends tslib_gmenu {
@@ -114,7 +113,7 @@ class tslib_gmenu_layers extends tslib_gmenu {
         * @return      void
         */
        function extProc_init() {
-               $this->WMid = trim($this->mconf['layer_menu_id'])?trim($this->mconf['layer_menu_id']).'x':substr(md5(microtime()),0,6); // NO '_' (underscore) in the ID!!! NN4 breaks!
+               $this->WMid = trim($this->mconf['layer_menu_id']) ? trim($this->mconf['layer_menu_id']) . 'x' : substr(md5('gl' . serialize($this->mconf)), 0, 6);
 
                $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'][]=$this->WMid;
                $this->WMtempStore = $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'];
@@ -423,8 +422,10 @@ GLV_timeout_count++;
 ';
                $GLOBALS['TSFE']->JSeventFuncCalls['onload']['GL_initLayers()']= 'GL_initLayers();';
                $GLOBALS['TSFE']->JSeventFuncCalls['onload'][$this->WMid]=      'GL_restoreMenu("'.$this->WMid.'");';
-               $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']['GL_getMouse(e)']= 'GL_getMouse(e);'; // Should be called BEFORE any of the 'local' getMouse functions!
-               $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove'][$this->WMid]= 'GL'.$this->WMid.'_getMouse(e);';
+               // Should be called BEFORE any of the 'local' getMouse functions!
+               // is put inside in a try catch block to avoid JS errors in IE
+               $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']['GL_getMouse(e)']= 'try{GL_getMouse(e);}catch(ex){};';
+               $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove'][$this->WMid]= 'try{GL'.$this->WMid.'_getMouse(e);}catch(ex){};';
                $GLOBALS['TSFE']->JSeventFuncCalls['onmouseup'][$this->WMid]= 'GL_mouseUp(\''.$this->WMid.'\',e);';
 
                $GLOBALS['TSFE']->divSection.=implode($this->divLayers,LF).LF;
index d732969..ab34b47 100644 (file)
@@ -27,7 +27,7 @@
 /**
  * Contains the TMENU_LAYERS extension class, tslib_tmenu_layers
  *
- * $Id: tmenu_layers.php 5165 2009-03-09 18:28:59Z ohader $
+ * $Id$
  * Revised for TYPO3 3.6 June/2003 by Kasper Skårhøj
  * XHTML compliant
  *
@@ -78,7 +78,6 @@
  * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage tslib
- * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=385&cHash=648519dd66
  * @see diff.xmenu_layers.txt
  */
 class tslib_tmenu_layers extends tslib_tmenu {
@@ -114,7 +113,7 @@ class tslib_tmenu_layers extends tslib_tmenu {
         * @return      void
         */
        function extProc_init() {
-               $this->WMid = trim($this->mconf['layer_menu_id'])?trim($this->mconf['layer_menu_id']).'x':substr(md5(microtime()),0,6); // NO '_' (underscore) in the ID!!! NN4 breaks!
+               $this->WMid = trim($this->mconf['layer_menu_id']) ? trim($this->mconf['layer_menu_id']) . 'x' : substr(md5('gl' . serialize($this->mconf)), 0, 6);
 
                $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'][]=$this->WMid;
                $this->WMtempStore = $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'];
@@ -423,8 +422,10 @@ GLV_timeout_count++;
 ';
                $GLOBALS['TSFE']->JSeventFuncCalls['onload']['GL_initLayers()']= 'GL_initLayers();';
                $GLOBALS['TSFE']->JSeventFuncCalls['onload'][$this->WMid]=      'GL_restoreMenu("'.$this->WMid.'");';
-               $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']['GL_getMouse(e)']= 'GL_getMouse(e);'; // Should be called BEFORE any of the 'local' getMouse functions!
-               $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove'][$this->WMid]= 'GL'.$this->WMid.'_getMouse(e);';
+               // Should be called BEFORE any of the 'local' getMouse functions!
+               // is put inside in a try catch block to avoid JS errors in IE
+               $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']['GL_getMouse(e)']= 'try{GL_getMouse(e);}catch(ex){};';
+               $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove'][$this->WMid]= 'try{GL'.$this->WMid.'_getMouse(e);}catch(ex){};';
                $GLOBALS['TSFE']->JSeventFuncCalls['onmouseup'][$this->WMid]= 'GL_mouseUp(\''.$this->WMid.'\',e);';
 
                $GLOBALS['TSFE']->divSection.=implode($this->divLayers,LF).LF;
index d416ef8..e1c5716 100644 (file)
 -$GLOBALS['TSFE']->tmpl->menuclasses.=',gmenu_layers';
 +$GLOBALS['TSFE']->tmpl->menuclasses.=',tmenu_layers';
  
--if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/gmenu_layers.php'])        {
--      include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/gmenu_layers.php']);
-+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/tmenu_layers.php'])        {
-+      include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/tmenu_layers.php']);
+-if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/gmenu_layers.php'])     {
+-      include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/gmenu_layers.php']);
++if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/tmenu_layers.php'])     {
++      include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/tmenu_layers.php']);
  }
  
  ?>