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