TYPO3 API  SVNRelease
tmenu_layers.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00027 /**
00028  * Contains the TMENU_LAYERS extension class, tslib_tmenu_layers
00029  *
00030  * $Id: tmenu_layers.php 5165 2009-03-09 18:28:59Z ohader $
00031  * Revised for TYPO3 3.6 June/2003 by Kasper Skårhøj
00032  * XHTML compliant
00033  *
00034  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00035  */
00036 /**
00037  * [CLASS/FUNCTION INDEX of SCRIPT]
00038  *
00039  *
00040  *
00041  *   84: class tslib_tmenu_layers extends tslib_tmenu
00042  *  116:     function extProc_init()
00043  *  134:     function extProc_RO($key)
00044  *  150:     function extProc_beforeLinking($key)
00045  *  205:     function extProc_afterLinking($key)
00046  *  240:     function extProc_beforeAllWrap($item,$key)
00047  *  253:     function isSetIntval($in)
00048  *  262:     function extProc_finish ()
00049  *  444:     function extCalcBorderWithin($kind,$integer)
00050  *
00051  * TOTAL FUNCTIONS: 8
00052  * (This index is automatically created/updated by the extension "extdeveval")
00053  *
00054  */
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 
00074 /**
00075  * Class extending tslib_tmenu for the creation of text based DHTML menus
00076  * 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'
00077  *
00078  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00079  * @package TYPO3
00080  * @subpackage tslib
00081  * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=385&cHash=648519dd66
00082  * @see diff.xmenu_layers.txt
00083  */
00084 class tslib_tmenu_layers extends tslib_tmenu {
00085 
00086 // FULL DUPLICATE FROM gmenu_layers BEGIN:
00087 
00088     var $GMENU_fixKey='layers';
00089     var $divLayers=Array();
00090 
00091     var $WMx=0;
00092     var $WMy=0;
00093     var $WMxyArray=array();
00094     var $WMextraScript='';
00095     var $WMlastKey='';
00096     var $WMrestoreScript='';
00097     var $WMresetSubMenus='';
00098     var $WMactiveHasSubMenu='';
00099     var $WMactiveKey='';
00100     var $WMtheSubMenu;
00101     var $WMisSub;
00102     var $WMhideCode;
00103     var $WMonlyOnLoad=0;
00104     var $WMbordersWithin=array();
00105     var $WMsubIds=array();
00106     var $WMtempStore=array();
00107     var $WMlockPosition_addAccumulated=array();
00108     var $VMmouseoverActions=array();
00109     var $VMmouseoutActions=array();
00110 
00111     /**
00112      * Creating unique menu id string plus other initialization of internal variables (all prefixed "WM")
00113      *
00114      * @return  void
00115      */
00116     function extProc_init() {
00117         $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!
00118 
00119         $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'][]=$this->WMid;
00120         $this->WMtempStore = $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'];
00121         $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array();
00122 
00123             // Save:
00124         $this->WMonlyOnLoad = ($this->mconf['displayActiveOnLoad'] && !$this->mconf['displayActiveOnLoad.']['onlyOnLoad']);
00125         $this->WMbordersWithin = t3lib_div::intExplode(',',$this->mconf['bordersWithin'].',0,0,0,0,0');
00126     }
00127 
00128     /**
00129      * Processing of mouse-over features depending on whether "freezeMouseover" property is set.
00130      *
00131      * @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
00132      * @return  void
00133      */
00134     function extProc_RO($key)   {
00135         if ($this->mconf['freezeMouseover'])    {
00136             $this->VMmouseoverActions[$this->WMid.$key]='case "Menu'.$this->WMid.$key.'":'.$this->I['linkHREF']['onMouseover'].'; break;';
00137             $this->VMmouseoutActions[$this->WMid.$key]='case "Menu'.$this->WMid.$key.'":'.$this->I['linkHREF']['onMouseout'].'; break;';
00138             $this->I['linkHREF']['onMouseover']='GL'.$this->WMid.'_over(\'Menu'.$this->WMid.$key.'\');';
00139             $this->I['linkHREF']['onMouseout']='';
00140         }
00141     }
00142 
00143     /**
00144      * Processing before the links are created.
00145      * This means primarily creating some javaScript code for the management.
00146      *
00147      * @param   integer     Pointer to $this->menuArr[$key] where the current menu element record is found
00148      * @return  void
00149      */
00150     function extProc_beforeLinking($key)    {
00151         if ($this->I['uid'])    {
00152 
00153             array_push($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId'],$this->WMid);
00154             $this->WMtheSubMenu = $this->subMenu($this->I['uid'], $this->WMsubmenuObjSuffixes[$key]['sOSuffix']);
00155             array_pop($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId']);
00156             $this->WMisSub = trim($this->WMtheSubMenu) ? 1 : 0;
00157 
00158             if ($this->mconf['lockPosition_addSelf'])       {
00159                 $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']);
00160                 $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']);
00161             }
00162 
00163             if ($this->isActive($this->I['uid'], $this->getMPvar($key)) && $this->mconf['displayActiveOnLoad']) {   // orig: && $this->WMisSub, changed 210901
00164                 $this->WMactiveHasSubMenu = $this->WMisSub;
00165                 $this->WMactiveKey = 'Menu'.$this->WMid.$key;
00166 
00167 
00168                 $this->WMrestoreVars=trim('
00169 GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
00170                 ');
00171                 $this->WMrestoreScript='    GL_doTop("'.$this->WMid.'",GLV_restoreMenu["'.$this->WMid.'"]);'.($this->mconf['freezeMouseover']?'
00172     GL'.$this->WMid.'_over(GLV_restoreMenu["'.$this->WMid.'"]);
00173 ':'');
00174             }
00175 
00176             if ($this->WMisSub) {
00177                 $event="GL_stopMove('".$this->WMid."');";
00178                 $this->I['linkHREF']['onMouseover']='GL_doTop(\''.$this->WMid.'\', \'Menu'.$this->WMid.$key.'\');'.$this->I['linkHREF']['onMouseover'];
00179                     // IESelectFix - Activates IFRAME layer below menu
00180                 if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover']=$this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'Menu'.$this->WMid.$key.'\',true);';
00181                     // 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).
00182                     // 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.
00183                 if (t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])  {
00184                     $event.='GL_resetAll("'.$this->WMid.'");';
00185                 }
00186                 $this->I['linkHREF']['onMouseout'].=$event;
00187             } else {
00188                 $this->I['linkHREF']['onMouseover'] = 'GL_hideAll("'.$this->WMid.'");'.$this->I['linkHREF']['onMouseover'];
00189                     // IESelectFix - Hides IFRAME layer below menu
00190                 if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover'] = $this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'\',false);';
00191                 $event='GL_resetAll("'.$this->WMid.'");';
00192                 $this->I['linkHREF']['onMouseout'].=$event;
00193             }
00194 
00195             $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).'");';
00196         }
00197     }
00198 
00199     /**
00200      * Processing after linking, basically setting the <div>-layers for the menu items. Also some more JavaScript code is made.
00201      *
00202      * @param   integer     Pointer to $this->menuArr[$key] where the current menu element record is found
00203      * @return  void
00204      */
00205     function extProc_afterLinking($key) {
00206         if ($this->I['uid'])    {
00207             if (!$this->I['spacer'] && $this->WMisSub)  {
00208                 $exStyle=$this->mconf['layerStyle'] ? $this->mconf['layerStyle'] : 'position:absolute;visibility:hidden';
00209                 if (trim($exStyle)) {
00210                     $exStyle=' '.$exStyle;
00211                 }
00212                 $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['layerCounter']++;
00213                 $zIndex = 10000-$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['layerCounter'];
00214 #               $zIndex = (($key+2)*$this->menuNumber*100);
00215                 $divStart = '<div id="Menu'.$this->WMid.$key.'" style="z-index:'.$zIndex.';'.$exStyle.'">';
00216                 $divStop = '</div>';
00217 
00218                 $this->divLayers[]= $divStart.$this->WMtheSubMenu.$divStop;
00219 
00220                 $this->WMhideCode.='
00221     GL_getObjCss("Menu'.$this->WMid.$key.'").visibility = "hidden";';
00222                 $this->WMlastKey = 'Menu'.$this->WMid.$key;
00223             }
00224 
00225             if (!$this->mconf['lockPosition_addSelf'])      {
00226                 $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']);
00227                 $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']);
00228             }
00229         }
00230         $this->WMresult.=$this->I['theItem'];
00231     }
00232 
00233     /**
00234      * Wrapping the item in a <div> section if 'relativeToTriggerItem' was set
00235      *
00236      * @param   string      The current content of the menu item, $this->I['theItem'], passed along.
00237      * @param   integer     Pointer to $this->menuArr[$key] where the current menu element record is found
00238      * @return  string      The modified version of $item, going back into $this->I['theItem']
00239      */
00240     function extProc_beforeAllWrap($item,$key)  {
00241         if ($this->mconf['relativeToTriggerItem'])  {
00242             $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>';
00243         }
00244         return $item;
00245     }
00246 
00247     /**
00248      * Returns true if different from ''  OR if intval()!=0
00249      *
00250      * @param   string      Value to evaluate
00251      * @return  boolean     true if $in is different from ''  OR if intval()!=0
00252      */
00253     function isSetIntval($in)   {
00254         return $this->mconf['blankStrEqFalse'] ? strcmp($in,'') : intval($in);
00255     }
00256 
00257     /**
00258      * Putting things together, in particular the JavaScript code needed for the DHTML menu.
00259      *
00260      * @return  mixed       Returns the value of a call to the parent function, parent::extProc_finish();
00261      */
00262     function extProc_finish ()  {
00263         $dirL = $this->mconf['directionLeft'] ? '-GL_getObj(id).width' : '';
00264         $dirU = $this->mconf['directionUp'] ? '-GL_getObj(id).height' : '';
00265 
00266         $parentLayerId = end($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId']);
00267 
00268         $DoTop=array();
00269         $GLV_menuOn=array();
00270         $relCode=array();
00271         $relFlag=0;
00272         if ($this->mconf['relativeToParentLayer'] && $parentLayerId)    {
00273             $relCode['X'].='GLV_curLayerX["'.$parentLayerId.'"]+';
00274             $relCode['Y'].='GLV_curLayerY["'.$parentLayerId.'"]+';
00275             if ($this->mconf['relativeToParentLayer.']['addWidth'])     {   $relCode['X'].='GLV_curLayerWidth["'.$parentLayerId.'"]+';  }
00276             if ($this->mconf['relativeToParentLayer.']['addHeight'])    {   $relCode['Y'].='GLV_curLayerHeight["'.$parentLayerId.'"]+'; }
00277         }
00278         if ($this->mconf['relativeToTriggerItem'])  {
00279             $DoTop[]='
00280         var parentObject = GL_getObj(GLV_menuXY[WMid][id][2]);
00281         var TI_width = parentObject.width;
00282         var TI_height = parentObject.height;
00283         var anchorObj = GL_getObj(GLV_menuXY[WMid][id][3]);
00284         var TI_x = anchorObj.x;
00285         var TI_y = anchorObj.y;
00286             ';
00287             $relCode['X'].='TI_x+';
00288             $relCode['Y'].='TI_y+';
00289 
00290             if ($this->mconf['relativeToTriggerItem.']['addWidth']) {   $relCode['X'].='TI_width+'; }
00291             if ($this->mconf['relativeToTriggerItem.']['addHeight'])    {   $relCode['Y'].='TI_height+';    }
00292             $relFlag=1;
00293         }
00294         if ($relFlag)   {
00295             $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";';
00296             $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top =  ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";';
00297         } else {
00298                 // X position (y is fixed)
00299             if (!strcmp($this->mconf['lockPosition'],'x'))  {
00300                 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].'GLV_menuXY["'.$this->WMid.'"][id][0]-('.intval($this->mconf['xPosOffset']).')'.$dirL.')+"px";';
00301                 if ($this->isSetIntval($this->mconf['topOffset']))  {
00302                     $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";';
00303                 }
00304             } elseif ($this->isSetIntval($this->mconf['xPosOffset'])) {
00305                 $GLV_menuOn[]=$DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = (GLV_x-('.intval($this->mconf['xPosOffset']).')'.$dirL.')+"px";';
00306                 if ($this->isSetIntval($this->mconf['topOffset']))  {
00307                     $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";';
00308                 }
00309             }
00310                 // Y position   (x is fixed)
00311             if (!strcmp($this->mconf['lockPosition'],'y'))  {
00312                 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].'GLV_menuXY["'.$this->WMid.'"][id][1]-('.intval($this->mconf['yPosOffset']).')'.$dirU.')+"px";';
00313                 if ($this->isSetIntval($this->mconf['leftOffset'])) {
00314                     $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";';
00315                 }
00316             } elseif ($this->isSetIntval($this->mconf['yPosOffset']))   {
00317                 $GLV_menuOn[]=$DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = (GLV_y-('.intval($this->mconf['yPosOffset']).')'.$dirU.')+"px";';
00318                 if ($this->isSetIntval($this->mconf['leftOffset'])) {
00319                     $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";';
00320                 }
00321             }
00322         }
00323 
00324             // BordersWithIn:
00325         $DoTop[]=$this->extCalcBorderWithin('left',$this->WMbordersWithin[0]);
00326         $DoTop[]=$this->extCalcBorderWithin('top',$this->WMbordersWithin[1]);
00327         $DoTop[]=$this->extCalcBorderWithin('right',$this->WMbordersWithin[2]);
00328         $DoTop[]=$this->extCalcBorderWithin('bottom',$this->WMbordersWithin[3]);
00329         $DoTop[]=$this->extCalcBorderWithin('left',$this->WMbordersWithin[4]);
00330         $DoTop[]=$this->extCalcBorderWithin('top',$this->WMbordersWithin[5]);
00331 
00332 
00333         if ($this->mconf['freezeMouseover'] && !$this->mconf['freezeMouseover.']['alwaysKeep']) {
00334             $this->WMhideCode.='
00335 GL'.$this->WMid.'_out("");';
00336         }
00337 
00338         $TEST='';
00339         if (count($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']))   {
00340             foreach ($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'] as $mIdStr) {
00341                 $this->WMhideCode.='
00342 GL_hideAll("'.$mIdStr.'");';
00343                 $this->WMrestoreScript.='
00344 GL_restoreMenu("'.$mIdStr.'");';
00345                 $this->WMresetSubMenus.='
00346 if (!GLV_doReset["'.$mIdStr.'"] && GLV_currentLayer["'.$mIdStr.'"]!=null)   resetSubMenu=0;';
00347             }
00348         }
00349             // IESelectFix - Adds IFRAME tag to HTML, Hides IFRAME layer below menu
00350         if ($this->mconf['ieSelectFix']) {
00351             $this->WMhideCode.= '
00352     GL_iframer(\''.$this->WMid.'\',\'\',false);';
00353             $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>';
00354         }
00355         $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array_merge($this->WMtempStore,$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']);
00356         $GLOBALS['TSFE']->additionalHeaderData['gmenu_layer_shared']='<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath('cms').'tslib/media/scripts/jsfunc.layermenu.js"></script>';
00357         $GLOBALS['TSFE']->JSCode.= '
00358 
00359 GLV_curLayerWidth["'.$this->WMid.'"]=0;
00360 GLV_curLayerHeight["'.$this->WMid.'"]=0;
00361 GLV_curLayerX["'.$this->WMid.'"]=0;
00362 GLV_curLayerY["'.$this->WMid.'"]=0;
00363 GLV_menuOn["'.$this->WMid.'"] = null;
00364 GLV_gap["'.$this->WMid.'"]='.t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600).';
00365 GLV_currentLayer["'.$this->WMid.'"] = null;
00366 GLV_currentROitem["'.$this->WMid.'"] = null;
00367 GLV_hasBeenOver["'.$this->WMid.'"]=0;
00368 GLV_doReset["'.$this->WMid.'"]=false;
00369 GLV_lastKey["'.$this->WMid.'"] = "'.$this->WMlastKey.'";
00370 GLV_onlyOnLoad["'.$this->WMid.'"] = '.($this->WMonlyOnLoad?1:0).';
00371 GLV_dontHideOnMouseUp["'.$this->WMid.'"] = '.($this->mconf['dontHideOnMouseUp']?1:0).';
00372 GLV_dontFollowMouse["'.$this->WMid.'"] = '.($this->mconf['dontFollowMouse']?1:0).';
00373 GLV_date = new Date();
00374 GLV_timeout["'.$this->WMid.'"] = GLV_date.getTime();
00375 GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_div::intInRange($this->mconf['hideMenuTimer'],0,20000).';
00376 GLV_menuXY["'.$this->WMid.'"] = new Array();
00377 '.implode(LF,$this->WMxyArray).'
00378 '.$this->WMrestoreVars;
00379 
00380         if ($this->mconf['freezeMouseover'])    {
00381             $GLOBALS['TSFE']->JSCode.= '
00382 // Alternative rollover/out functions for use with GMENU_LAYER
00383 function GL'.$this->WMid.'_over(mitm_id)    {
00384     GL'.$this->WMid.'_out("");  // removes any old roll over state of an item. Needed for alwaysKeep and Opera browsers.
00385     switch(mitm_id) {
00386 '.implode(LF,$this->VMmouseoverActions).'
00387     }
00388     GLV_currentROitem["'.$this->WMid.'"]=mitm_id;
00389 }
00390 function GL'.$this->WMid.'_out(mitm_id) {
00391     if (!mitm_id)   mitm_id=GLV_currentROitem["'.$this->WMid.'"];
00392     switch(mitm_id) {
00393 '.implode(LF,$this->VMmouseoutActions).'
00394     }
00395 }
00396 ';
00397         }
00398         $GLOBALS["TSFE"]->JSCode.= '
00399 function GL'.$this->WMid.'_getMouse(e) {
00400     if (GLV_menuOn["'.$this->WMid.'"]!=null && !GLV_dontFollowMouse["'.$this->WMid.'"]){
00401 '.implode(LF,$GLV_menuOn).'
00402     }
00403     GL_mouseMoveEvaluate("'.$this->WMid.'");
00404 }
00405 function GL'.$this->WMid.'_hideCode() {
00406 '.$this->WMhideCode.'
00407 }
00408 function GL'.$this->WMid.'_doTop(WMid,id) {
00409 '.trim(implode(LF,$DoTop)).'
00410 }
00411 function GL'.$this->WMid.'_restoreMenu() {
00412 '.$this->WMrestoreScript.'
00413 }
00414 function GL'.$this->WMid.'_resetSubMenus() {
00415     var resetSubMenu=1;
00416 '.$this->WMresetSubMenus.'
00417     return resetSubMenu;
00418 }
00419 
00420 GLV_timeout_pointers[GLV_timeout_count] = "'.$this->WMid.'";
00421 GLV_timeout_count++;
00422 
00423 ';
00424         $GLOBALS['TSFE']->JSeventFuncCalls['onload']['GL_initLayers()']= 'GL_initLayers();';
00425         $GLOBALS['TSFE']->JSeventFuncCalls['onload'][$this->WMid]=  'GL_restoreMenu("'.$this->WMid.'");';
00426         $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']['GL_getMouse(e)']= 'GL_getMouse(e);'; // Should be called BEFORE any of the 'local' getMouse functions!
00427         $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove'][$this->WMid]= 'GL'.$this->WMid.'_getMouse(e);';
00428         $GLOBALS['TSFE']->JSeventFuncCalls['onmouseup'][$this->WMid]= 'GL_mouseUp(\''.$this->WMid.'\',e);';
00429 
00430         $GLOBALS['TSFE']->divSection.=implode($this->divLayers,LF).LF;
00431 
00432         return parent::extProc_finish();
00433     }
00434 
00435     /**
00436      * Creates a JavaScript line which corrects the position of the layer based on the constraints in TypoScript property 'bordersWithin'
00437      *
00438      * @param   string      Direction to test.
00439      * @param   integer     The boundary limit in the direction set by $kind. If set then a value is returned, otherwise blank.
00440      * @return  string      JavaScript string for correction of the layer position (if $integer is true)
00441      * @see extProc_finish(), extProc_init()
00442      */
00443     function extCalcBorderWithin($kind,$integer)    {
00444         if ($integer)   {
00445             switch($kind)   {
00446                 case 'right':
00447                 case 'bottom':
00448                     $add='';
00449                     if ($kind=='right')     {$add='GL_getObj(id).width'; $key = 'left';}
00450                     if ($kind=='bottom')    {$add='GL_getObj(id).height'; $key = 'top';}
00451                     $str = 'if (parseInt(GLV_menuOn["'.$this->WMid.'"].'.$key.')+'.$add.'>'.$integer.') GLV_menuOn["'.$this->WMid.'"].'.$key.'='.$integer.'-'.$add.';';
00452                 break;
00453                 default:
00454                     $str = 'if (parseInt(GLV_menuOn["'.$this->WMid.'"].'.$kind.')<'.$integer.') GLV_menuOn["'.$this->WMid.'"].'.$kind.'='.$integer.';';
00455                 break;
00456             }
00457         }
00458         return $str;
00459     }
00460 }
00461 
00462 // FULL DUPLICATE FROM gmenu_layers END:
00463 
00464 
00465 $GLOBALS['TSFE']->tmpl->menuclasses.=',tmenu_layers';
00466 
00467 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/tmenu_layers.php'])) {
00468     include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['media/scripts/tmenu_layers.php']);
00469 }
00470 
00471 ?>