00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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']);
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']) {
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>';
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="'.$GLOBALS['TSFE']->absRefPrefix.'media/scripts/jsfunc.layermenu.js"></script>';
00174 $GLOBALS['TSFE']->additionalHeaderData['gmenu_foldout']='<script type="text/javascript" src="'.$GLOBALS['TSFE']->absRefPrefix.'media/scripts/jsfunc.foldout.js"></script>';
00175
00176 $GLOBALS["TSFE"]->additionalHeaderData[].= '
00177 <style type="text/css">
00178
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
00195 <!--
00196 GFV_foldNumber='.$this->WMmenuItems.';
00197 GFV_foldTimer='.t3lib_div::intInRange(($this->mconf['foldTimer']?$this->mconf['foldTimer']:40) ,1,3000).';
00198 GFV_foldSpeed='.t3lib_div::intInRange($this->mconf['foldSpeed'],1,100).';
00199 GFV_stayFolded='.($this->mconf['stayFolded'] ? 'true' : 'false').';
00200 GFV_foldImg='.$this->WMimagesFlag.';
00201 GFV_currentFold=null;
00202 GFV_foldStep1=null;
00203 GFV_foldStep2=null;
00204 GFV_step=0;
00205 GFV_active=false;
00206 GFV_adjustTopHeights = '.$adjustTopHeights.';
00207 GFV_adjustSubHeights = '.$adjustSubHeights.';
00208 if (bw.opera) {
00209 GFV_scrX= innerWidth;
00210 GFV_scrY= innerHeight;
00211 }
00212
00213
00214
00215 var GFV_unImg=new Image();
00216 GFV_unImg.src="'.$GLOBALS['TSFE']->absRefPrefix.$this->WMarrowNO[3].'";
00217
00218 var GFV_exImg=new Image();
00219 GFV_exImg.src="'.$GLOBALS['TSFE']->absRefPrefix.$this->WMarrowACT[3].'";
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 ?>