Public Member Functions | |
extProc_init () | |
Creating unique menu id string plus other initialization of internal variables (all prefixed "WM"). | |
extProc_RO ($key) | |
Processing of mouse-over features depending on whether "freezeMouseover" property is set. | |
extProc_beforeLinking ($key) | |
Processing before the links are created. | |
extProc_afterLinking ($key) | |
Processing after linking, basically setting the -layers for the menu items. | |
extProc_beforeAllWrap ($item, $key) | |
Wrapping the item in a section if 'relativeToTriggerItem' was set. | |
isSetIntval ($in) | |
Returns true if different from '' OR if intval()!=0. | |
extProc_finish () | |
Putting things together, in particular the JavaScript code needed for the DHTML menu. | |
extCalcBorderWithin ($kind, $integer) | |
Creates a JavaScript line which corrects the position of the layer based on the constraints in TypoScript property 'bordersWithin'. | |
Public Attributes | |
$GMENU_fixKey = 'layers' | |
$divLayers = Array() | |
$WMx = 0 | |
$WMy = 0 | |
$WMxyArray = array() | |
$WMextraScript = '' | |
$WMlastKey = '' | |
$WMrestoreScript = '' | |
$WMresetSubMenus = '' | |
$WMactiveHasSubMenu = '' | |
$WMactiveKey = '' | |
$WMtheSubMenu | |
$WMisSub | |
$WMhideCode | |
$WMonlyOnLoad = 0 | |
$WMbordersWithin = array() | |
$WMsubIds = array() | |
$WMtempStore = array() | |
$WMlockPosition_addAccumulated = array() | |
$VMmouseoverActions = array() | |
$VMmouseoutActions = array() |
|
Creates a JavaScript line which corrects the position of the layer based on the constraints in TypoScript property 'bordersWithin'.
Definition at line 435 of file tmenu_layers.php. References $key. Referenced by extProc_finish(). 00435 { 00436 if ($integer) { 00437 switch($kind) { 00438 case 'right': 00439 case 'bottom': 00440 $add=''; 00441 if ($kind=='right') {$add='GL_getObj(id).width'; $key = 'left';} 00442 if ($kind=='bottom') {$add='GL_getObj(id).height'; $key = 'top';} 00443 $str = 'if (parseInt(GLV_menuOn["'.$this->WMid.'"].'.$key.')+'.$add.'>'.$integer.') GLV_menuOn["'.$this->WMid.'"].'.$key.'='.$integer.'-'.$add.';'; 00444 break; 00445 default: 00446 $str = 'if (parseInt(GLV_menuOn["'.$this->WMid.'"].'.$kind.')<'.$integer.') GLV_menuOn["'.$this->WMid.'"].'.$kind.'='.$integer.';'; 00447 break; 00448 } 00449 } 00450 return $str; 00451 }
|
|
Processing after linking, basically setting the -layers for the menu items.
Also some more JavaScript code is made.
Definition at line 202 of file tmenu_layers.php. References spacer(). 00202 { 00203 if ($this->I['uid']) { 00204 if (!$this->I['spacer'] && $this->WMisSub) { 00205 $exStyle=$this->mconf['layerStyle'] ? $this->mconf['layerStyle'] : 'position:absolute;visibility:hidden'; 00206 if (trim($exStyle)) { 00207 $exStyle=' '.$exStyle; 00208 } 00209 $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['layerCounter']++; 00210 $zIndex = 10000-$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['layerCounter']; 00211 # $zIndex = (($key+2)*$this->menuNumber*100); 00212 $divStart = '<div id="Menu'.$this->WMid.$key.'" style="z-index:'.$zIndex.';'.$exStyle.'">'; 00213 $divStop = '</div>'; 00214 00215 $this->divLayers[]= $divStart.$this->WMtheSubMenu.$divStop; 00216 00217 $this->WMhideCode.=' 00218 GL_getObjCss("Menu'.$this->WMid.$key.'").visibility = "hidden";'; 00219 $this->WMlastKey = 'Menu'.$this->WMid.$key; 00220 } 00221 00222 if (!$this->mconf['lockPosition_addSelf']) { 00223 $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']); 00224 $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']); 00225 } 00226 } 00227 $this->WMresult.=$this->I['theItem']; 00228 }
|
|
Wrapping the item in a section if 'relativeToTriggerItem' was set.
Definition at line 237 of file tmenu_layers.php. 00237 { 00238 if ($this->mconf['relativeToTriggerItem']) { 00239 $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>'; 00240 } 00241 return $item; 00242 }
|
|
Processing before the links are created. This means primarily creating some javaScript code for the management.
Definition at line 151 of file tmenu_layers.php. References tslib_menu::isActive(), and tslib_menu::subMenu(). 00151 { 00152 if ($this->I['uid']) { 00153 00154 array_push($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId'],$this->WMid); 00155 $this->WMtheSubMenu = $this->subMenu($this->I['uid']); 00156 array_pop($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId']); 00157 $this->WMisSub = trim($this->WMtheSubMenu) ? 1 : 0; 00158 00159 if ($this->mconf['lockPosition_addSelf']) { 00160 $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']); 00161 $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']); 00162 } 00163 00164 if ($this->isActive($this->I['uid'], $this->getMPvar($key)) && $this->mconf['displayActiveOnLoad']) { // orig: && $this->WMisSub, changed 210901 00165 $this->WMactiveHasSubMenu = $this->WMisSub; 00166 $this->WMactiveKey = 'Menu'.$this->WMid.$key; 00167 00168 00169 $this->WMrestoreVars=trim(' 00170 GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'"; 00171 '); 00172 $this->WMrestoreScript=' GL_doTop("'.$this->WMid.'",GLV_restoreMenu["'.$this->WMid.'"]);'.($this->mconf['freezeMouseover']?' 00173 GL'.$this->WMid.'_over(GLV_restoreMenu["'.$this->WMid.'"]); 00174 ':''); 00175 } 00176 00177 if ($this->WMisSub) { 00178 $event="GL_stopMove('".$this->WMid."');"; 00179 $this->I['linkHREF']['onMouseover']='GL_doTop(\''.$this->WMid.'\', \'Menu'.$this->WMid.$key.'\');'.$this->I['linkHREF']['onMouseover']; 00180 // 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). 00181 // 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. 00182 if (t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer']) { 00183 $event.='GL_resetAll("'.$this->WMid.'");'; 00184 } 00185 $this->I['linkHREF']['onMouseout'].=$event; 00186 } else { 00187 $this->I['linkHREF']['onMouseover']='GL_hideAll("'.$this->WMid.'");'.$this->I['linkHREF']['onMouseover']; 00188 $event='GL_resetAll("'.$this->WMid.'");'; 00189 $this->I['linkHREF']['onMouseout'].=$event; 00190 } 00191 00192 $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).'");'; 00193 } 00194 }
|
|
Putting things together, in particular the JavaScript code needed for the DHTML menu.
Definition at line 259 of file tmenu_layers.php. References extCalcBorderWithin(), extProc_finish(), and isSetIntval(). 00259 { 00260 $dirL = $this->mconf['directionLeft'] ? '-GL_getObj(id).width' : ''; 00261 $dirU = $this->mconf['directionUp'] ? '-GL_getObj(id).height' : ''; 00262 00263 $parentLayerId = end($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId']); 00264 00265 $DoTop=array(); 00266 $GLV_menuOn=array(); 00267 $relCode=array(); 00268 $relFlag=0; 00269 if ($this->mconf['relativeToParentLayer'] && $parentLayerId) { 00270 $relCode['X'].='GLV_curLayerX["'.$parentLayerId.'"]+'; 00271 $relCode['Y'].='GLV_curLayerY["'.$parentLayerId.'"]+'; 00272 if ($this->mconf['relativeToParentLayer.']['addWidth']) { $relCode['X'].='GLV_curLayerWidth["'.$parentLayerId.'"]+'; } 00273 if ($this->mconf['relativeToParentLayer.']['addHeight']) { $relCode['Y'].='GLV_curLayerHeight["'.$parentLayerId.'"]+'; } 00274 } 00275 if ($this->mconf['relativeToTriggerItem']) { 00276 $DoTop[]=' 00277 var parentObject = GL_getObj(GLV_menuXY[WMid][id][2]); 00278 var TI_width = parentObject.width; 00279 var TI_height = parentObject.height; 00280 var anchorObj = GL_getObj(GLV_menuXY[WMid][id][3]); 00281 var TI_x = anchorObj.x; 00282 var TI_y = anchorObj.y; 00283 '; 00284 $relCode['X'].='TI_x+'; 00285 $relCode['Y'].='TI_y+'; 00286 00287 if ($this->mconf['relativeToTriggerItem.']['addWidth']) { $relCode['X'].='TI_width+'; } 00288 if ($this->mconf['relativeToTriggerItem.']['addHeight']) { $relCode['Y'].='TI_height+'; } 00289 $relFlag=1; 00290 } 00291 if ($relFlag) { 00292 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";'; 00293 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";'; 00294 } else { 00295 // X position (y is fixed) 00296 if (!strcmp($this->mconf['lockPosition'],'x')) { 00297 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].'GLV_menuXY["'.$this->WMid.'"][id][0]-('.intval($this->mconf['xPosOffset']).')'.$dirL.')+"px";'; 00298 if ($this->isSetIntval($this->mconf['topOffset'])) { 00299 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";'; 00300 } 00301 } elseif ($this->isSetIntval($this->mconf['xPosOffset'])) { 00302 $GLV_menuOn[]=$DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = (GLV_x-('.intval($this->mconf['xPosOffset']).')'.$dirL.')+"px";'; 00303 if ($this->isSetIntval($this->mconf['topOffset'])) { 00304 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].intval($this->mconf['topOffset']).$dirU.')+"px";'; 00305 } 00306 } 00307 // Y position (x is fixed) 00308 if (!strcmp($this->mconf['lockPosition'],'y')) { 00309 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = ('.$relCode['Y'].'GLV_menuXY["'.$this->WMid.'"][id][1]-('.intval($this->mconf['yPosOffset']).')'.$dirU.')+"px";'; 00310 if ($this->isSetIntval($this->mconf['leftOffset'])) { 00311 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";'; 00312 } 00313 } elseif ($this->isSetIntval($this->mconf['yPosOffset'])) { 00314 $GLV_menuOn[]=$DoTop[]='GLV_menuOn["'.$this->WMid.'"].top = (GLV_y-('.intval($this->mconf['yPosOffset']).')'.$dirU.')+"px";'; 00315 if ($this->isSetIntval($this->mconf['leftOffset'])) { 00316 $DoTop[]='GLV_menuOn["'.$this->WMid.'"].left = ('.$relCode['X'].intval($this->mconf['leftOffset']).$dirL.')+"px";'; 00317 } 00318 } 00319 } 00320 00321 // BordersWithIn: 00322 $DoTop[]=$this->extCalcBorderWithin('left',$this->WMbordersWithin[0]); 00323 $DoTop[]=$this->extCalcBorderWithin('top',$this->WMbordersWithin[1]); 00324 $DoTop[]=$this->extCalcBorderWithin('right',$this->WMbordersWithin[2]); 00325 $DoTop[]=$this->extCalcBorderWithin('bottom',$this->WMbordersWithin[3]); 00326 $DoTop[]=$this->extCalcBorderWithin('left',$this->WMbordersWithin[4]); 00327 $DoTop[]=$this->extCalcBorderWithin('top',$this->WMbordersWithin[5]); 00328 00329 00330 if ($this->mconf['freezeMouseover'] && !$this->mconf['freezeMouseover.']['alwaysKeep']) { 00331 $this->WMhideCode.=' 00332 GL'.$this->WMid.'_out("");'; 00333 } 00334 00335 $TEST=''; 00336 if (count($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'])) { 00337 reset($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']); 00338 while(list(,$mIdStr)=each($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'])) { 00339 $this->WMhideCode.=' 00340 GL_hideAll("'.$mIdStr.'");'; 00341 $this->WMrestoreScript.=' 00342 GL_restoreMenu("'.$mIdStr.'");'; 00343 $this->WMresetSubMenus.=' 00344 if (!GLV_doReset["'.$mIdStr.'"] && GLV_currentLayer["'.$mIdStr.'"]!=null) resetSubMenu=0;'; 00345 } 00346 } 00347 $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array_merge($this->WMtempStore,$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']); 00348 $GLOBALS['TSFE']->additionalHeaderData['gmenu_layer_shared']='<script type="text/javascript" src="'.$GLOBALS['TSFE']->absRefPrefix.'media/scripts/jsfunc.layermenu.js"></script>'; 00349 $GLOBALS['TSFE']->JSCode.= ' 00350 00351 GLV_curLayerWidth["'.$this->WMid.'"]=0; 00352 GLV_curLayerHeight["'.$this->WMid.'"]=0; 00353 GLV_curLayerX["'.$this->WMid.'"]=0; 00354 GLV_curLayerY["'.$this->WMid.'"]=0; 00355 GLV_menuOn["'.$this->WMid.'"] = null; 00356 GLV_gap["'.$this->WMid.'"]='.t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600).'; 00357 GLV_currentLayer["'.$this->WMid.'"] = null; 00358 GLV_currentROitem["'.$this->WMid.'"] = null; 00359 GLV_hasBeenOver["'.$this->WMid.'"]=0; 00360 GLV_doReset["'.$this->WMid.'"]=false; 00361 GLV_lastKey["'.$this->WMid.'"] = "'.$this->WMlastKey.'"; 00362 GLV_onlyOnLoad["'.$this->WMid.'"] = '.($this->WMonlyOnLoad?1:0).'; 00363 GLV_dontHideOnMouseUp["'.$this->WMid.'"] = '.($this->mconf['dontHideOnMouseUp']?1:0).'; 00364 GLV_dontFollowMouse["'.$this->WMid.'"] = '.($this->mconf['dontFollowMouse']?1:0).'; 00365 GLV_date = new Date(); 00366 GLV_timeout["'.$this->WMid.'"] = GLV_date.getTime(); 00367 GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_div::intInRange($this->mconf['hideMenuTimer'],0,20000).'; 00368 GLV_menuXY["'.$this->WMid.'"] = new Array(); 00369 '.implode(chr(10),$this->WMxyArray).' 00370 '.$this->WMrestoreVars; 00371 00372 if ($this->mconf['freezeMouseover']) { 00373 $GLOBALS['TSFE']->JSCode.= ' 00374 // Alternative rollover/out functions for use with GMENU_LAYER 00375 function GL'.$this->WMid.'_over(mitm_id) { 00376 GL'.$this->WMid.'_out(""); // removes any old roll over state of an item. Needed for alwaysKeep and Opera browsers. 00377 switch(mitm_id) { 00378 '.implode(chr(10),$this->VMmouseoverActions).' 00379 } 00380 GLV_currentROitem["'.$this->WMid.'"]=mitm_id; 00381 } 00382 function GL'.$this->WMid.'_out(mitm_id) { 00383 if (!mitm_id) mitm_id=GLV_currentROitem["'.$this->WMid.'"]; 00384 switch(mitm_id) { 00385 '.implode(chr(10),$this->VMmouseoutActions).' 00386 } 00387 } 00388 '; 00389 } 00390 $GLOBALS["TSFE"]->JSCode.= ' 00391 function GL'.$this->WMid.'_getMouse(e) { 00392 if (GLV_menuOn["'.$this->WMid.'"]!=null && !GLV_dontFollowMouse["'.$this->WMid.'"]){ 00393 '.implode(chr(10),$GLV_menuOn).' 00394 } 00395 GL_mouseMoveEvaluate("'.$this->WMid.'"); 00396 } 00397 function GL'.$this->WMid.'_hideCode() { 00398 '.$this->WMhideCode.' 00399 } 00400 function GL'.$this->WMid.'_doTop(WMid,id) { 00401 '.trim(implode(chr(10),$DoTop)).' 00402 } 00403 function GL'.$this->WMid.'_restoreMenu() { 00404 '.$this->WMrestoreScript.' 00405 } 00406 function GL'.$this->WMid.'_resetSubMenus() { 00407 var resetSubMenu=1; 00408 '.$this->WMresetSubMenus.' 00409 return resetSubMenu; 00410 } 00411 00412 GLV_timeout_pointers[GLV_timeout_count] = "'.$this->WMid.'"; 00413 GLV_timeout_count++; 00414 00415 '; 00416 $GLOBALS['TSFE']->JSeventFuncCalls['onload']['GL_initLayers()']= 'GL_initLayers();'; 00417 $GLOBALS['TSFE']->JSeventFuncCalls['onload'][$this->WMid]= 'GL_restoreMenu("'.$this->WMid.'");'; 00418 $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']['GL_getMouse(e)']= 'GL_getMouse(e);'; // Should be called BEFORE any of the 'local' getMouse functions! 00419 $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove'][$this->WMid]= 'GL'.$this->WMid.'_getMouse(e);'; 00420 $GLOBALS['TSFE']->JSeventFuncCalls['onmouseup'][$this->WMid]= 'GL_mouseUp(\''.$this->WMid.'\',e);'; 00421 00422 $GLOBALS['TSFE']->divSection.=implode($this->divLayers,chr(10)).chr(10); 00423 00424 return parent::extProc_finish(); 00425 }
|
|
Creating unique menu id string plus other initialization of internal variables (all prefixed "WM").
Definition at line 117 of file tmenu_layers.php. 00117 { 00118 $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! 00119 00120 $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'][]=$this->WMid; 00121 $this->WMtempStore = $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']; 00122 $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array(); 00123 00124 // Save: 00125 $this->WMonlyOnLoad = ($this->mconf['displayActiveOnLoad'] && !$this->mconf['displayActiveOnLoad.']['onlyOnLoad']); 00126 $this->WMbordersWithin = t3lib_div::intExplode(',',$this->mconf['bordersWithin'].',0,0,0,0,0'); 00127 }
|
|
Processing of mouse-over features depending on whether "freezeMouseover" property is set.
Definition at line 135 of file tmenu_layers.php. 00135 { 00136 if ($this->mconf['freezeMouseover']) { 00137 $this->VMmouseoverActions[$this->WMid.$key]='case "Menu'.$this->WMid.$key.'":'.$this->I['linkHREF']['onMouseover'].'; break;'; 00138 $this->VMmouseoutActions[$this->WMid.$key]='case "Menu'.$this->WMid.$key.'":'.$this->I['linkHREF']['onMouseout'].'; break;'; 00139 $this->I['linkHREF']['onMouseover']='GL'.$this->WMid.'_over(\'Menu'.$this->WMid.$key.'\');'; 00140 $this->I['linkHREF']['onMouseout']=''; 00141 } 00142 }
|
|
Returns true if different from '' OR if intval()!=0.
Definition at line 250 of file tmenu_layers.php. Referenced by extProc_finish(). 00250 {
00251 return $this->mconf['blankStrEqFalse'] ? strcmp($in,'') : intval($in);
00252 }
|
|
Definition at line 90 of file tmenu_layers.php. |
|
Reimplemented from tslib_menu. Definition at line 89 of file tmenu_layers.php. |
|
Definition at line 110 of file tmenu_layers.php. |
|
Definition at line 109 of file tmenu_layers.php. |
|
Definition at line 99 of file tmenu_layers.php. |
|
Definition at line 100 of file tmenu_layers.php. |
|
Definition at line 105 of file tmenu_layers.php. |
|
Reimplemented from tslib_menu. Definition at line 95 of file tmenu_layers.php. |
|
Definition at line 103 of file tmenu_layers.php. |
|
Definition at line 102 of file tmenu_layers.php. |
|
Definition at line 96 of file tmenu_layers.php. |
|
Definition at line 108 of file tmenu_layers.php. |
|
Definition at line 104 of file tmenu_layers.php. |
|
Definition at line 98 of file tmenu_layers.php. |
|
Definition at line 97 of file tmenu_layers.php. |
|
Definition at line 106 of file tmenu_layers.php. |
|
Definition at line 107 of file tmenu_layers.php. |
|
Definition at line 101 of file tmenu_layers.php. |
|
Definition at line 92 of file tmenu_layers.php. |
|
Definition at line 94 of file tmenu_layers.php. |
|
Definition at line 93 of file tmenu_layers.php. |