Documentation TYPO3 par Ameos |
00001 <?php 00002 /*************************************************************** 00003 * Copyright notice 00004 * 00005 * (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com) 00006 * All rights reserved 00007 * 00008 * This script is part of the TYPO3 project. The TYPO3 project is 00009 * free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * The GNU General Public License can be found at 00015 * http://www.gnu.org/copyleft/gpl.html. 00016 * A copy is found in the textfile GPL.txt and important notices to the license 00017 * from the author is found in LICENSE.txt distributed with these scripts. 00018 * 00019 * 00020 * This script is distributed in the hope that it will be useful, 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 * GNU General Public License for more details. 00024 * 00025 * This copyright notice MUST APPEAR in all copies of the script! 00026 ***************************************************************/ 00080 class tslib_gmenu_foldout extends tslib_gmenu { 00081 var $GMENU_fixKey='foldout'; 00082 00083 var $WMarrowNO; 00084 var $WMarrowACT; 00085 var $WMimagesFlag; 00086 var $WMimageHTML; 00087 var $WMsubmenu; 00088 var $WMtableWrap; 00089 var $WM_activeOnLoad=''; 00090 00096 function extProc_init() { 00097 $this->WMarrowNO=''; 00098 $this->WMarrowACT=''; 00099 $this->WMimagesFlag=0; 00100 $this->WMimageHTML =''; 00101 if (($this->mconf['arrowNO']||$this->mconf['arrowNO.']) && ($this->mconf['arrowACT']||$this->mconf['arrowACT.'])) { 00102 $this->WMarrowNO = $GLOBALS['TSFE']->cObj->getImgResource($this->mconf['arrowNO'],$this->mconf['arrowNO.']); 00103 $this->WMarrowACT = $GLOBALS['TSFE']->cObj->getImgResource($this->mconf['arrowACT'],$this->mconf['arrowACT.']); 00104 if (is_array($this->WMarrowACT) && is_array($this->WMarrowNO)) { 00105 $this->WMimagesFlag=1; 00106 } 00107 } 00108 } 00109 00117 function extProc_beforeLinking($key) { 00118 $this->I['addATagParams']=''; 00119 $this->WMsubmenu = $this->subMenu($this->I['uid'], $this->WMsubmenuObjSuffixes[$key]['sOSuffix']); 00120 if (trim($this->WMsubmenu)) { 00121 $this->I['addATagParams']=' onclick="GF_menu('.$key.');'.($this->mconf['dontLinkIfSubmenu'] ? ' return false;' : '').'"'; 00122 if ($this->isActive($this->I['uid'], $this->getMPvar($key)) && $this->mconf['displayActiveOnLoad']) { // orig: && $this->WMisSub, changed 210901 00123 $this->WM_activeOnLoad='GF_menu('.$key.');'; 00124 } 00125 } 00126 } 00127 00134 function extProc_afterLinking($key) { 00135 $this->WMtableWrap = $this->mconf['dontWrapInTable'] ? '' : '<table cellspacing="0" cellpadding="0" width="100%" border="0"><tr><td>|</td></tr></table>'; 00136 00137 if ($this->WMimagesFlag) { 00138 $this->WMimageHTML='<img src="'.$GLOBALS['TSFE']->absRefPrefix.$this->WMarrowNO[3].'" width="'.$this->WMarrowNO[0].'" height="'.$this->WMarrowNO[1].'" border="0" name="imgA'.$key.'"'.($this->mconf['arrowImgParams']?' '.$this->mconf['arrowImgParams']:'').' alt="" />'; 00139 } else {$this->WMimageHTML="";} 00140 00141 if (strstr($this->I['theItem'], '###ARROW_IMAGE###')) { 00142 $this->I['theItem'] = str_replace('###ARROW_IMAGE###', $this->WMimageHTML, $this->I['theItem']); 00143 } else { 00144 $this->I['theItem'] = $this->WMimageHTML.$this->I['theItem']; 00145 } 00146 00147 $this->WMresult.= ' 00148 <div class="clTop" id="divTop'.($key+1).'">'.$this->tmpl->wrap($this->I['theItem'], $this->WMtableWrap).' 00149 <div class="clSub" id="divSub'.($key+1).'"> 00150 '.$this->WMsubmenu.' 00151 </div> 00152 </div>'; // Originally a <br /> between the div-tags, but it seemed to break stuff. 00153 } 00154 00160 function extProc_finish() { 00161 $bHeight = t3lib_div::intInRange(($this->mconf['bottomHeight']?$this->mconf['bottomHeight']:100) ,0,3000); 00162 $bottomContent = $this->mconf['bottomContent'] ? $GLOBALS['TSFE']->cObj->cObjGetSingle($this->mconf['bottomContent'],$this->mconf['bottomContent.'], '/GMENU_FOLDOUT/.bottomContent') : ''; 00163 $adjustTopHeights = intval($this->mconf['adjustItemsH']); 00164 $adjustSubHeights = intval($this->mconf['adjustSubItemsH']); 00165 $mWidth = t3lib_div::intInRange(($this->mconf['menuWidth']?$this->mconf['menuWidth']:170) ,0,3000); 00166 $mHeight = t3lib_div::intInRange(($this->mconf['menuHeight']?$this->mconf['menuHeight']:400) ,0,3000); 00167 $insertmColor= $this->mconf['menuBackColor'] ? 'BACKGROUND-COLOR: '.$this->mconf['menuBackColor'].'; layer-background-color: '.$this->mconf['menuBackColor'] : ''; 00168 $insertBottomColor= $this->mconf['bottomBackColor'] ? 'BACKGROUND-COLOR: '.$this->mconf['bottomBackColor'].'; layer-background-color: '.$this->mconf['bottomBackColor'] : ''; 00169 $menuOffset = t3lib_div::intExplode(',',$this->mconf['menuOffset'].','); 00170 $subOffset = t3lib_div::intExplode(',',$this->mconf['subMenuOffset'].','); 00171 00172 00173 $GLOBALS['TSFE']->additionalHeaderData['gmenu_layer_shared']='<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath('cms').'tslib/media/scripts/jsfunc.layermenu.js"></script>'; 00174 $GLOBALS['TSFE']->additionalHeaderData['gmenu_foldout']='<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath('cms').'tslib/media/scripts/jsfunc.foldout.js"></script>'; 00175 00176 $GLOBALS["TSFE"]->additionalHeaderData[].= ' 00177 <style type="text/css"> 00178 /*<![CDATA[*/ 00179 #divCont { 00180 Z-INDEX: 1; LEFT: '.$menuOffset[0].'px; VISIBILITY: hidden; WIDTH: '.$mWidth.'px; POSITION: absolute; TOP: '.$menuOffset[1].'px; HEIGHT: '.$mHeight.'px 00181 } 00182 .clTop { 00183 Z-INDEX: 1; WIDTH: '.$mWidth.'px; POSITION: absolute; '.$insertmColor.' 00184 } 00185 .clSub { 00186 Z-INDEX: 1; LEFT: '.$subOffset[0].'px; WIDTH: '.$mWidth.'px; POSITION: absolute; TOP: '.$subOffset[1].'px 00187 } 00188 .bottomLayer { 00189 Z-INDEX: 1; WIDTH: '.$mWidth.'px; CLIP: rect(0px '.$mWidth.'px '.$bHeight.'px 0px); POSITION: absolute; HEIGHT: '.$bHeight.'px; '.$insertBottomColor.' 00190 } 00191 /*]]>*/ 00192 </style> 00193 <script type="text/javascript"> 00194 /*<![CDATA[*/ 00195 <!-- 00196 GFV_foldNumber='.$this->WMmenuItems.'; //How many toplinks do you have? 00197 GFV_foldTimer='.t3lib_div::intInRange(($this->mconf['foldTimer']?$this->mconf['foldTimer']:40) ,1,3000).'; //The timeout in the animation, these are milliseconds. 00198 GFV_foldSpeed='.t3lib_div::intInRange($this->mconf['foldSpeed'],1,100).'; //How many steps in an animation? 00199 GFV_stayFolded='.($this->mconf['stayFolded'] ? 'true' : 'false').'; //Stay open when you click a new toplink? 00200 GFV_foldImg='.$this->WMimagesFlag.'; //Do you want images (if not set to 0 and remove the images from the body)? 00201 GFV_currentFold=null; 00202 GFV_foldStep1=null; 00203 GFV_foldStep2=null; 00204 GFV_step=0; 00205 GFV_active=false; //Don\'t change this one. 00206 GFV_adjustTopHeights = '.$adjustTopHeights.'; 00207 GFV_adjustSubHeights = '.$adjustSubHeights.'; 00208 if (bw.opera) { 00209 GFV_scrX= innerWidth; 00210 GFV_scrY= innerHeight; 00211 } 00212 00213 //This is the default image. 00214 //Remember to change the actual images in the page as well, but remember to keep the name of the image. 00215 var GFV_unImg=new Image(); 00216 GFV_unImg.src="'.$GLOBALS['TSFE']->absRefPrefix.$this->WMarrowNO[3].'"; 00217 00218 var GFV_exImg=new Image(); //Making an image variable... 00219 GFV_exImg.src="'.$GLOBALS['TSFE']->absRefPrefix.$this->WMarrowACT[3].'"; //...this is the source of the image that it changes to when the menu expands. 00220 00221 //--> 00222 /*]]>*/ 00223 </script> 00224 '; 00225 00226 $GLOBALS['TSFE']->JSeventFuncCalls['onmousemove']['GF_resizeForOpera()']= 'GF_resizeForOpera();'; 00227 $GLOBALS['TSFE']->JSeventFuncCalls['onload']['GMENU_FOLDOUT']= 'if(bw.bw) {GF_initFoldout();'.$this->WM_activeOnLoad.'}'; 00228 00229 $GLOBALS['TSFE']->divSection.= ' 00230 <div id="divCont"><!-- These are the contents of the foldoutmenu. --> 00231 '.$this->tmpl->wrap($this->WMresult,$this->mconf['wrap']).' 00232 <div class="bottomLayer" id="divTop'.($this->WMmenuItems+1).'"> 00233 <div class="clSub" id="divSub'.($this->WMmenuItems+1).'"><!-- This is a cover layer, it should always be the last one, and does NOT count in your number of toplinks! --><!-- So if this one is divTop7, the GFV_foldNumber variable should be set to 6 --><!-- This layer covers up the last sub, so if the last sub gets too big, increase this layers size in the stylesheet. --><!-- There are tables with width="100%" around the toplinks, to force NS4 to use the real width specified for the toplinks in the stylesheet. --> 00234 </div>'.$this->tmpl->wrap($bottomContent, $this->WMtableWrap).' 00235 </div> 00236 </div><!-- Here ends the foldoutmenu. --> 00237 '; 00238 return ''; 00239 } 00240 } 00241 00242 $GLOBALS['TSFE']->tmpl->menuclasses.=',gmenu_foldout'; 00243 00244 00245 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/gmenu_foldout.php']) { 00246 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['media/scripts/gmenu_foldout.php']); 00247 } 00248 00249 ?>