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