📄 tmenu_layers.php
字号:
<?php/**************************************************************** Copyright notice** (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)* All rights reserved** This script is part of the TYPO3 project. The TYPO3 project is* free software; you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation; either version 2 of the License, or* (at your option) any later version.** The GNU General Public License can be found at* http://www.gnu.org/copyleft/gpl.html.* A copy is found in the textfile GPL.txt and important notices to the license* from the author is found in LICENSE.txt distributed with these scripts.*** This script is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** This copyright notice MUST APPEAR in all copies of the script!***************************************************************//** * Contains the TMENU_LAYERS extension class, tslib_tmenu_layers * * $Id: tmenu_layers.php 1421 2006-04-10 09:27:15Z mundaun $ * Revised for TYPO3 3.6 June/2003 by Kasper Skaarhoj * XHTML compliant * * @author Kasper Skaarhoj <kasperYYYY@typo3.com> *//** * [CLASS/FUNCTION INDEX of SCRIPT] * * * * 84: class tslib_tmenu_layers extends tslib_tmenu * 116: function extProc_init() * 134: function extProc_RO($key) * 150: function extProc_beforeLinking($key) * 205: function extProc_afterLinking($key) * 240: function extProc_beforeAllWrap($item,$key) * 253: function isSetIntval($in) * 262: function extProc_finish () * 444: function extCalcBorderWithin($kind,$integer) * * TOTAL FUNCTIONS: 8 * (This index is automatically created/updated by the extension "extdeveval") * *//** * Class extending tslib_tmenu for the creation of text based DHTML menus * 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' * * @author Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tslib * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=385&cHash=648519dd66 * @see diff.xmenu_layers.txt */class tslib_tmenu_layers extends tslib_tmenu {// FULL DUPLICATE FROM gmenu_layers BEGIN: var $GMENU_fixKey='layers'; var $divLayers=Array(); var $WMx=0; var $WMy=0; var $WMxyArray=array(); var $WMextraScript=''; var $WMlastKey=''; var $WMrestoreScript=''; var $WMresetSubMenus=''; var $WMactiveHasSubMenu=''; var $WMactiveKey=''; var $WMtheSubMenu; var $WMisSub; var $WMhideCode; var $WMonlyOnLoad=0; var $WMbordersWithin=array(); var $WMsubIds=array(); var $WMtempStore=array(); var $WMlockPosition_addAccumulated=array(); var $VMmouseoverActions=array(); var $VMmouseoutActions=array(); /** * Creating unique menu id string plus other initialization of internal variables (all prefixed "WM") * * @return void */ function extProc_init() { $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! $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'][]=$this->WMid; $this->WMtempStore = $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']; $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array(); // Save: $this->WMonlyOnLoad = ($this->mconf['displayActiveOnLoad'] && !$this->mconf['displayActiveOnLoad.']['onlyOnLoad']); $this->WMbordersWithin = t3lib_div::intExplode(',',$this->mconf['bordersWithin'].',0,0,0,0,0'); } /** * Processing of mouse-over features depending on whether "freezeMouseover" property is set. * * @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 * @return void */ function extProc_RO($key) { if ($this->mconf['freezeMouseover']) { $this->VMmouseoverActions[$this->WMid.$key]='case "Menu'.$this->WMid.$key.'":'.$this->I['linkHREF']['onMouseover'].'; break;'; $this->VMmouseoutActions[$this->WMid.$key]='case "Menu'.$this->WMid.$key.'":'.$this->I['linkHREF']['onMouseout'].'; break;'; $this->I['linkHREF']['onMouseover']='GL'.$this->WMid.'_over(\'Menu'.$this->WMid.$key.'\');'; $this->I['linkHREF']['onMouseout']=''; } } /** * Processing before the links are created. * This means primarily creating some javaScript code for the management. * * @param integer Pointer to $this->menuArr[$key] where the current menu element record is found * @return void */ function extProc_beforeLinking($key) { if ($this->I['uid']) { array_push($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId'],$this->WMid); $this->WMtheSubMenu = $this->subMenu($this->I['uid'], $this->WMsubmenuObjSuffixes[$key]['sOSuffix']); array_pop($GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMparentId']); $this->WMisSub = trim($this->WMtheSubMenu) ? 1 : 0; if ($this->mconf['lockPosition_addSelf']) { $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']); $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']); } if ($this->isActive($this->I['uid'], $this->getMPvar($key)) && $this->mconf['displayActiveOnLoad']) { // orig: && $this->WMisSub, changed 210901 $this->WMactiveHasSubMenu = $this->WMisSub; $this->WMactiveKey = 'Menu'.$this->WMid.$key; $this->WMrestoreVars=trim('GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'"; '); $this->WMrestoreScript=' GL_doTop("'.$this->WMid.'",GLV_restoreMenu["'.$this->WMid.'"]);'.($this->mconf['freezeMouseover']?' GL'.$this->WMid.'_over(GLV_restoreMenu["'.$this->WMid.'"]);':''); } if ($this->WMisSub) { $event="GL_stopMove('".$this->WMid."');"; $this->I['linkHREF']['onMouseover']='GL_doTop(\''.$this->WMid.'\', \'Menu'.$this->WMid.$key.'\');'.$this->I['linkHREF']['onMouseover']; // IESelectFix - Activates IFRAME layer below menu if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover']=$this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'Menu'.$this->WMid.$key.'\',true);'; // 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). // 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. if (t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer']) { $event.='GL_resetAll("'.$this->WMid.'");'; } $this->I['linkHREF']['onMouseout'].=$event; } else { $this->I['linkHREF']['onMouseover'] = 'GL_hideAll("'.$this->WMid.'");'.$this->I['linkHREF']['onMouseover']; // IESelectFix - Hides IFRAME layer below menu if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover'] = $this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'\',false);'; $event='GL_resetAll("'.$this->WMid.'");'; $this->I['linkHREF']['onMouseout'].=$event; } $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).'");'; } } /** * Processing after linking, basically setting the <div>-layers for the menu items. Also some more JavaScript code is made. * * @param integer Pointer to $this->menuArr[$key] where the current menu element record is found * @return void */ function extProc_afterLinking($key) { if ($this->I['uid']) { if (!$this->I['spacer'] && $this->WMisSub) { $exStyle=$this->mconf['layerStyle'] ? $this->mconf['layerStyle'] : 'position:absolute;visibility:hidden'; if (trim($exStyle)) { $exStyle=' '.$exStyle; } $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['layerCounter']++; $zIndex = 10000-$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['layerCounter'];# $zIndex = (($key+2)*$this->menuNumber*100); $divStart = '<div id="Menu'.$this->WMid.$key.'" style="z-index:'.$zIndex.';'.$exStyle.'">'; $divStop = '</div>'; $this->divLayers[]= $divStart.$this->WMtheSubMenu.$divStop; $this->WMhideCode.=' GL_getObjCss("Menu'.$this->WMid.$key.'").visibility = "hidden";'; $this->WMlastKey = 'Menu'.$this->WMid.$key; } if (!$this->mconf['lockPosition_addSelf']) { $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']); $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']); } } $this->WMresult.=$this->I['theItem']; } /** * Wrapping the item in a <div> section if 'relativeToTriggerItem' was set * * @param string The current content of the menu item, $this->I['theItem'], passed along. * @param integer Pointer to $this->menuArr[$key] where the current menu element record is found
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -