This commit was manufactured by cvs2svn to create tag
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / media / scripts / gmenu_layers.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Contains the GMENU_LAYERS extension class, tslib_gmenu_layers
29 *
30 * $Id$
31 * Revised for TYPO3 3.6 June/2003 by Kasper Skaarhoj
32 * XHTML compliant
33 *
34 * @author Kasper Skaarhoj <kasper@typo3.com>
35 */
36 /**
37 * [CLASS/FUNCTION INDEX of SCRIPT]
38 *
39 *
40 *
41 * 84: class tslib_gmenu_layers extends tslib_gmenu
42 * 116: function extProc_init()
43 * 134: function extProc_RO($key)
44 * 150: function extProc_beforeLinking($key)
45 * 201: function extProc_afterLinking($key)
46 * 236: function extProc_beforeAllWrap($item,$key)
47 * 249: function isSetIntval($in)
48 * 258: function extProc_finish ()
49 * 434: function extCalcBorderWithin($kind,$integer)
50 *
51 * TOTAL FUNCTIONS: 8
52 * (This index is automatically created/updated by the extension "extdeveval")
53 *
54 */
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74 /**
75 * Class extending tslib_gmenu for the creation of DHTML menus
76 * NOTICE: The contents of this class is made so that it can be copied EXACTLY AS IS to the tmenu_layers class! See noties in class (for BEGIN/END) and also "diff.xmenu_layers.txt"
77 *
78 * @author Kasper Skaarhoj <kasper@typo3.com>
79 * @package TYPO3
80 * @subpackage tslib
81 * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=385&cHash=648519dd66
82 * @see diff.xmenu_layers.txt
83 */
84 class tslib_gmenu_layers extends tslib_gmenu {
85
86 // FULL DUPLICATE TO tmenu_layers BEGIN:
87
88 var $GMENU_fixKey='layers';
89 var $divLayers=Array();
90
91 var $WMx=0;
92 var $WMy=0;
93 var $WMxyArray=array();
94 var $WMextraScript='';
95 var $WMlastKey='';
96 var $WMrestoreScript='';
97 var $WMresetSubMenus='';
98 var $WMactiveHasSubMenu='';
99 var $WMactiveKey='';
100 var $WMtheSubMenu;
101 var $WMisSub;
102 var $WMhideCode;
103 var $WMonlyOnLoad=0;
104 var $WMbordersWithin=array();
105 var $WMsubIds=array();
106 var $WMtempStore=array();
107 var $WMlockPosition_addAccumulated=array();
108 var $VMmouseoverActions=array();
109 var $VMmouseoutActions=array();
110
111 /**
112 * Creating unique menu id string plus other initialization of internal variables (all prefixed "WM")
113 *
114 * @return void
115 */
116 function extProc_init() {
117 $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!
118
119 $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'][]=$this->WMid;
120 $this->WMtempStore = $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'];
121 $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array();
122
123 // Save:
124 $this->WMonlyOnLoad = ($this->mconf['displayActiveOnLoad'] && !$this->mconf['displayActiveOnLoad.']['onlyOnLoad']);
125 $this->WMbordersWithin = t3lib_div::intExplode(',',$this->mconf['bordersWithin'].',0,0,0,0,0');
126 }
127
128 /**
129 * Processing of mouse-over features depending on whether "freezeMouseover" property is set.
130 *
131 * @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
132 * @return void
133 */
134 function extProc_RO($key) {
135 if ($this->mconf['freezeMouseover']) {
136 $this->VMmouseoverActions[$this->WMid.$key]='case "Menu'.$this->WMid.$key.'":'.$this->I['linkHREF']['onMouseover'].'; break;';
137 $this->VMmouseoutActions[$this->WMid.$key]='case "Menu'.$this->WMid.$key.'":'.$this->I['linkHREF']['onMouseout'].'; break;';
138 $this->I['linkHREF']['onMouseover']='GL'.$this->WMid.'_over(\'Menu'.$this->WMid.$key.'\');';
139 $this->I['linkHREF']['onMouseout']='';
140 }
141 }
142
143 /**
144 * Processing before the links are created.
145 * This means primarily creating some javaScript code for the management.
146 *
147 * @param integer Pointer to $this->menuArr[$key] where the current menu element record is found
148 * @return void
149 */
150 function extProc_beforeLinking($key) {
151 if ($this->I['uid']) {
152
153 array_push($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId'],$this->WMid);
154 $this->WMtheSubMenu = $this->subMenu($this->I['uid']);
155 array_pop($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId']);
156 $this->WMisSub = trim($this->WMtheSubMenu) ? 1 : 0;
157
158 if ($this->mconf['lockPosition_addSelf']) {
159 $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']);
160 $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']);
161 }
162
163 if ($this->isActive($this->I['uid'], $this->getMPvar($key)) && $this->mconf['displayActiveOnLoad']) { // orig: && $this->WMisSub, changed 210901
164 $this->WMactiveHasSubMenu = $this->WMisSub;
165 $this->WMactiveKey = 'Menu'.$this->WMid.$key;
166
167
168 $this->WMrestoreVars=trim('
169 GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
170 ');
171 $this->WMrestoreScript=' GL_doTop("'.$this->WMid.'",GLV_restoreMenu["'.$this->WMid.'"]);'.($this->mconf['freezeMouseover']?'
172 GL'.$this->WMid.'_over(GLV_restoreMenu["'.$this->WMid.'"]);
173 ':'');
174 }
175
176 if ($this->WMisSub) {
177 $event="GL_stopMove('".$this->WMid."');";
178 $this->I['linkHREF']['onMouseover']='GL_doTop(\''.$this->WMid.'\', \'Menu'.$this->WMid.$key.'\');'.$this->I['linkHREF']['onMouseover'];
179 // 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).
180 // 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.
181 if (t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer']) {
182 $event.='GL_resetAll("'.$this->WMid.'");';
183 }
184 $this->I['linkHREF']['onMouseout'].=$event;
185 } else {
186 $this->I['linkHREF']['onMouseover']='GL_hideAll("'.$this->WMid.'");'.$this->I['linkHREF']['onMouseover'];
187 $event='GL_resetAll("'.$this->WMid.'");';
188 $this->I['linkHREF']['onMouseout'].=$event;
189 }
190
191 $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).'");';
192 }
193 }
194
195 /**
196 * Processing after linking, basically setting the <div>-layers for the menu items. Also some more JavaScript code is made.
197 *
198 * @param integer Pointer to $this->menuArr[$key] where the current menu element record is found
199 * @return void
200 */
201 function extProc_afterLinking($key) {
202 if ($this->I['uid']) {
203 if (!$this->I['spacer'] && $this->WMisSub) {
204 $exStyle=$this->mconf['layerStyle'] ? $this->mconf['layerStyle'] : 'position:absolute;visibility:hidden';
205 if (trim($exStyle)) {
206 $exStyle=' '.$exStyle;
207 }
208 $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['layerCounter']++;
209 $zIndex = 10000-$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['layerCounter'];
210 # $zIndex = (($key+2)*$this->menuNumber*100);
211 $divStart = '<div id="Menu'.$this->WMid.$key.'" style="z-index:'.$zIndex.';'.$exStyle.'">';
212 $divStop = '</div>';
213
214 $this->divLayers[]= $divStart.$this->WMtheSubMenu.$divStop;
215
216 $this->WMhideCode.='
217 GL_getObjCss("Menu'.$this->WMid.$key.'").visibility = "hidden";';
218 $this->WMlastKey = 'Menu'.$this->WMid.$key;
219 }
220
221 if (!$this->mconf['lockPosition_addSelf']) {
222 $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']);
223 $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']);
224 }
225 }
226 $this->WMresult.=$this->I['theItem'];
227 }
228
229 /**
230 * Wrapping the item in a <div> section if 'relativeToTriggerItem' was set
231 *
232 * @param string The current content of the menu item, $this->I['theItem'], passed along.
233 * @param integer Pointer to $this->menuArr[$key] where the current menu element record is found
234 * @return string The modified version of $item, going back into $this->I['theItem']
235 */
236 function extProc_beforeAllWrap($item,$key) {
237 if ($this->mconf['relativeToTriggerItem']) {
238 $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>';
239 }
240 return $item;
241 }
242
243 /**
244 * Returns true if different from '' OR if intval()!=0
245 *
246 * @param string Value to evaluate
247 * @return boolean true if $in is different from '' OR if intval()!=0
248 */
249 function isSetIntval($in) {
250 return $this->mconf['blankStrEqFalse'] ? strcmp($in,'') : intval($in);
251 }
252
253 /**
254 * Putting things together, in particular the JavaScript code needed for the DHTML menu.
255 *
256 * @return mixed Returns the value of a call to the parent function, parent::extProc_finish();
257 */
258 function extProc_finish () {
259 $dirL = $this->mconf['directionLeft'] ? '-GL_getObj(id).width' : '';
260 $dirU = $this->mconf['directionUp'] ? '-GL_getObj(id).height' : '';
261
262 $parentLayerId = end($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId']);
263
264 $DoTop=array();
265 $GLV_menuOn=array();
266 $relCode=array();
267 $relFlag=0;
268 if ($this->mconf['relativeToParentLayer'] && $parentLayerId) {
269 $relCode['X'].='GLV_curLayerX["'.$parentLayerId.'"]+';
270 $relCode['Y'].='GLV_curLayerY["'.$parentLayerId.'"]+';
271 if ($this->mconf['relativeToParentLayer.']['addWidth']) { $relCode['X'].='GLV_curLayerWidth["'.$parentLayerId.'"]+'; }
272 if ($this->mconf['relativeToParentLayer.']['addHeight']) { $relCode['Y'].='GLV_curLayerHeight["'.$parentLayerId.'"]+'; }
273 }
274 if ($this->mconf['relativeToTriggerItem']) {
275 $DoTop[]='
276 var parentObject = GL_getObj(GLV_menuXY[WMid][id][2]);
277 var TI_width = parentObject.width;
278 var TI_height = parentObject.height;
279 var anchorObj = GL_getObj(GLV_menuXY[WMid][id][3]);
280 var TI_x = anchorObj.x;
281 var TI_y = anchorObj.y;
282 ';
283 $relCode['X'].='TI_x+';
284 $relCode['Y'].='TI_y+';
285
286 if ($this->mconf['relativeToTriggerItem.']['addWidth']) { $relCode['X'].='TI_width+'; }
287 if ($this->mconf['relativeToTriggerItem.']['addHeight']) { $relCode['Y'].='TI_height+'; }
288 $relFlag=1;
289 }
290 if ($relFlag) {
291 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";';
292 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";';
293 } else {
294 // X position (y is fixed)
295 if (!strcmp($this->mconf['lockPosition'],'x')) {
296 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].'GLV_menuXY["'.$this->WMid.'"][id][0]-('.intval($this->mconf['xPosOffset']).')'.$dirL.')+"px";';
297 if ($this->isSetIntval($this->mconf['topOffset'])) {
298 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";';
299 }
300 } elseif ($this->isSetIntval($this->mconf['xPosOffset'])) {
301 $GLV_menuOn[]=$DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = (GLV_x-('.intval($this->mconf['xPosOffset']).')'.$dirL.')+"px";';
302 if ($this->isSetIntval($this->mconf['topOffset'])) {
303 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";';
304 }
305 }
306 // Y position (x is fixed)
307 if (!strcmp($this->mconf['lockPosition'],'y')) {
308 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].'GLV_menuXY["'.$this->WMid.'"][id][1]-('.intval($this->mconf['yPosOffset']).')'.$dirU.')+"px";';
309 if ($this->isSetIntval($this->mconf['leftOffset'])) {
310 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";';
311 }
312 } elseif ($this->isSetIntval($this->mconf['yPosOffset'])) {
313 $GLV_menuOn[]=$DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = (GLV_y-('.intval($this->mconf['yPosOffset']).')'.$dirU.')+"px";';
314 if ($this->isSetIntval($this->mconf['leftOffset'])) {
315 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";';
316 }
317 }
318 }
319
320 // BordersWithIn:
321 $DoTop[]=$this->extCalcBorderWithin('left',$this->WMbordersWithin[0]);
322 $DoTop[]=$this->extCalcBorderWithin('top',$this->WMbordersWithin[1]);
323 $DoTop[]=$this->extCalcBorderWithin('right',$this->WMbordersWithin[2]);
324 $DoTop[]=$this->extCalcBorderWithin('bottom',$this->WMbordersWithin[3]);
325 $DoTop[]=$this->extCalcBorderWithin('left',$this->WMbordersWithin[4]);
326 $DoTop[]=$this->extCalcBorderWithin('top',$this->WMbordersWithin[5]);
327
328
329 if ($this->mconf['freezeMouseover'] && !$this->mconf['freezeMouseover.']['alwaysKeep']) {
330 $this->WMhideCode.='
331 GL'.$this->WMid.'_out("");';
332 }
333
334 $TEST='';
335 if (count($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'])) {
336 reset($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']);
337 while(list(,$mIdStr)=each($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'])) {
338 $this->WMhideCode.='
339 GL_hideAll("'.$mIdStr.'");';
340 $this->WMrestoreScript.='
341 GL_restoreMenu("'.$mIdStr.'");';
342 $this->WMresetSubMenus.='
343 if (!GLV_doReset["'.$mIdStr.'"] && GLV_currentLayer["'.$mIdStr.'"]!=null) resetSubMenu=0;';
344 }
345 }
346 $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array_merge($this->WMtempStore,$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']);
347 $GLOBALS['TSFE']->additionalHeaderData['gmenu_layer_shared']='<script type="text/javascript" src="'.$GLOBALS['TSFE']->absRefPrefix.'media/scripts/jsfunc.layermenu.js"></script>';
348 $GLOBALS['TSFE']->JSCode.= '
349
350 GLV_curLayerWidth["'.$this->WMid.'"]=0;
351 GLV_curLayerHeight["'.$this->WMid.'"]=0;
352 GLV_curLayerX["'.$this->WMid.'"]=0;
353 GLV_curLayerY["'.$this->WMid.'"]=0;
354 GLV_menuOn["'.$this->WMid.'"] = null;
355 GLV_gap["'.$this->WMid.'"]='.t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600).';
356 GLV_currentLayer["'.$this->WMid.'"] = null;
357 GLV_currentROitem["'.$this->WMid.'"] = null;
358 GLV_hasBeenOver["'.$this->WMid.'"]=0;
359 GLV_doReset["'.$this->WMid.'"]=false;
360 GLV_lastKey["'.$this->WMid.'"] = "'.$this->WMlastKey.'";
361 GLV_onlyOnLoad["'.$this->WMid.'"] = '.($this->WMonlyOnLoad?1:0).';
362 GLV_dontHideOnMouseUp["'.$this->WMid.'"] = '.($this->mconf['dontHideOnMouseUp']?1:0).';
363 GLV_dontFollowMouse["'.$this->WMid.'"] = '.($this->mconf['dontFollowMouse']?1:0).';
364 GLV_date = new Date();
365 GLV_timeout["'.$this->WMid.'"] = GLV_date.getTime();
366 GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_div::intInRange($this->mconf['hideMenuTimer'],0,20000).';
367 GLV_menuXY["'.$this->WMid.'"] = new Array();
368 '.implode(chr(10),$this->WMxyArray).'
369 '.$this->WMrestoreVars;
370
371 if ($this->mconf['freezeMouseover']) {
372 $GLOBALS['TSFE']->JSCode.= '
373 // Alternative rollover/out functions for use with GMENU_LAYER
374 function GL'.$this->WMid.'_over(mitm_id) {
375 GL'.$this->WMid.'_out(""); // removes any old roll over state of an item. Needed for alwaysKeep and Opera browsers.
376 switch(mitm_id) {
377 '.implode(chr(10),$this->VMmouseoverActions).'
378 }
379 GLV_currentROitem["'.$this->WMid.'"]=mitm_id;
380 }
381 function GL'.$this->WMid.'_out(mitm_id) {
382 if (!mitm_id) mitm_id=GLV_currentROitem["'.$this->WMid.'"];
383 switch(mitm_id) {
384 '.implode(chr(10),$this->VMmouseoutActions).'
385 }
386 }
387 ';
388 }
389 $GLOBALS["TSFE"]->JSCode.= '
390 function GL'.$this->WMid.'_getMouse(e) {
391 if (GLV_menuOn["'.$this->WMid.'"]!=null && !GLV_dontFollowMouse["'.$this->WMid.'"]){
392 '.implode(chr(10),$GLV_menuOn).'
393 }
394 GL_mouseMoveEvaluate("'.$this->WMid.'");
395 }
396 function GL'.$this->WMid.'_hideCode() {
397 '.$this->WMhideCode.'
398 }
399 function GL'.$this->WMid.'_doTop(WMid,id) {
400 '.trim(implode(chr(10),$DoTop)).'
401 }
402 function GL'.$this->WMid.'_restoreMenu() {
403 '.$this->WMrestoreScript.'
404 }
405 function GL'.$this->WMid.'_resetSubMenus() {
406 var resetSubMenu=1;
407 '.$this->WMresetSubMenus.'
408 return resetSubMenu;
409 }
410
411 GLV_timeout_pointers[GLV_timeout_count] = "'.$this->WMid.'";
412 GLV_timeout_count++;
413
414 ';
415 $GLOBALS['TSFE']->JSeventFuncCalls['onload']['GL_initLayers()']= 'GL_initLayers();';
416 $GLOBALS['TSFE']->JSeventFuncCalls['onload'][$this->WMid]= 'GL_restoreMenu("'.$this->WMid.'");';
417 $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']['GL_getMouse(e)']= 'GL_getMouse(e);'; // Should be called BEFORE any of the 'local' getMouse functions!
418 $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove'][$this->WMid]= 'GL'.$this->WMid.'_getMouse(e);';
419 $GLOBALS['TSFE']->JSeventFuncCalls['onmouseup'][$this->WMid]= 'GL_mouseUp(\''.$this->WMid.'\',e);';
420
421 $GLOBALS['TSFE']->divSection.=implode($this->divLayers,chr(10)).chr(10);
422
423 return parent::extProc_finish();
424 }
425
426 /**
427 * Creates a JavaScript line which corrects the position of the layer based on the constraints in TypoScript property 'bordersWithin'
428 *
429 * @param string Direction to test.
430 * @param integer The boundary limit in the direction set by $kind. If set then a value is returned, otherwise blank.
431 * @return string JavaScript string for correction of the layer position (if $integer is true)
432 * @see extProc_finish(), extProc_init()
433 */
434 function extCalcBorderWithin($kind,$integer) {
435 if ($integer) {
436 switch($kind) {
437 case 'right':
438 case 'bottom':
439 $add='';
440 if ($kind=='right') {$add='GL_getObj(id).width'; $key = 'left';}
441 if ($kind=='bottom') {$add='GL_getObj(id).height'; $key = 'top';}
442 $str = 'if (parseInt(GLV_menuOn["'.$this->WMid.'"].'.$key.')+'.$add.'>'.$integer.') GLV_menuOn["'.$this->WMid.'"].'.$key.'='.$integer.'-'.$add.';';
443 break;
444 default:
445 $str = 'if (parseInt(GLV_menuOn["'.$this->WMid.'"].'.$kind.')<'.$integer.') GLV_menuOn["'.$this->WMid.'"].'.$kind.'='.$integer.';';
446 break;
447 }
448 }
449 return $str;
450 }
451 }
452
453
454 // FULL DUPLICATE TO tmenu_layers END:
455
456 $GLOBALS['TSFE']->tmpl->menuclasses.=',gmenu_layers';
457
458 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/gmenu_layers.php']) {
459 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/gmenu_layers.php']);
460 }
461
462 ?>