Main Page | Directories | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages | Examples

tslib_tmenu Class Reference

Inherits tslib_menu.

Inherited by tslib_tmenu_layers.

List of all members.

Public Member Functions

 generate ()
 Calls procesItemStates() so that the common configuration for the menu items are resolved into individual configuration per item.
 writeMenu ()
 Traverses the ->result array of menu items configuration (made by ->generate()) and renders each item.
 getBeforeAfter ($pref)
 Generates the before* and after* images for TMENUs.


Member Function Documentation

tslib_tmenu::generate  ) 
 

Calls procesItemStates() so that the common configuration for the menu items are resolved into individual configuration per item.

Sets the result for the new "normal state" in $this->result

Returns:
void
See also:
tslib_menu::procesItemStates()

Definition at line 1425 of file class.tslib_menu.php.

References debug(), and tslib_menu::procesItemStates().

01425                         {
01426       $splitCount = count($this->menuArr);
01427       if ($splitCount)  {
01428          list($NOconf) = $this->procesItemStates($splitCount);
01429       }
01430       if ($this->mconf['debugItemConf'])  {echo '<h3>$NOconf:</h3>'; debug($NOconf);   }
01431       $this->result = $NOconf;
01432    }

tslib_tmenu::getBeforeAfter pref  ) 
 

Generates the before* and after* images for TMENUs.

Parameters:
string Can be "before" or "after" and determines which kind of image to create (basically this is the prefix of the TypoScript properties that are read from the ->I['val'] array
Returns:
string The resulting HTML of the image, if any. &tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=388&cHash=a7486044cd

Definition at line 1582 of file class.tslib_menu.php.

References spacer().

Referenced by writeMenu().

tslib_tmenu::writeMenu  ) 
 

Traverses the ->result array of menu items configuration (made by ->generate()) and renders each item.

During the execution of this function many internal methods prefixed "extProc_" from this class is called and many of these are for now dummy functions. But they can be used for processing as they are used by the TMENU_LAYERS An instance of tslib_cObj is also made and for each menu item rendered it is loaded with the record for that page so that any stdWrap properties that applies will have the current menu items record available.

Returns:
string The HTML for the menu (returns result through $this->extProc_finish(); )

Definition at line 1441 of file class.tslib_menu.php.

References $out, extProc_finish(), getBeforeAfter(), tslib_menu::link(), linkWrap(), tslib_menu::setATagParts(), spacer(), stdWrap(), and tslib_menu::userProcess().

01441                         {
01442       if (is_array($this->result) && count($this->result))  {
01443          $this->WMcObj =t3lib_div::makeInstance('tslib_cObj'); // Create new tslib_cObj for our use
01444          $this->WMresult='';
01445          $this->INPfixMD5 = substr(md5(microtime().'tmenu'),0,4);
01446          $this->WMmenuItems = count($this->result);
01447          $this->extProc_init();
01448          reset($this->result);
01449          while (list($key,$val)=each($this->result))  {
01450             $GLOBALS['TSFE']->register['count_HMENU_MENUOBJ']++;
01451             $GLOBALS['TSFE']->register['count_MENUOBJ']++;
01452 
01453             $this->I=array();
01454             $this->WMcObj->start($this->menuArr[$key],'pages');      // Initialize the cObj with the page record of the menu item
01455             $this->I['key'] = $key;
01456             $this->I['INPfix']= $this->imgNameNotRandom?'':'_'.$this->INPfixMD5.'_'.$key;
01457             $this->I['val'] = $val;
01458             $this->I['title'] = $this->WMcObj->stdWrap($this->getPageTitle($this->menuArr[$key]['title'],$this->menuArr[$key]['nav_title']),$this->I['val']['stdWrap.']);
01459             $this->I['uid'] = $this->menuArr[$key]['uid'];
01460             $this->I['mount_pid'] = $this->menuArr[$key]['mount_pid'];
01461             $this->I['pid'] = $this->menuArr[$key]['pid'];
01462             $this->I['spacer'] = $this->menuArr[$key]['isSpacer'];
01463 
01464                // Make link tag
01465             $this->I['val']['ATagParams'] = $this->I['val']['ATagParams'] ? ' '.$this->I['val']['ATagParams'] : '';
01466             $this->I['linkHREF'] =  $this->link($key,$this->I['val']['altTarget'],$this->mconf['forceTypeValue']);
01467 
01468                // Title attribute of links:
01469             $titleAttrValue = $this->WMcObj->stdWrap($this->I['val']['ATagTitle'],$this->I['val']['ATagTitle.']);
01470             if (strlen($titleAttrValue))  {
01471                $this->I['linkHREF']['title'] = $titleAttrValue;
01472             }
01473 
01474                // Setting "blurlink()" function:
01475             if (!$this->mconf['noBlur'])  {
01476                $this->I['linkHREF']['onFocus']='blurLink(this);';
01477             }
01478 
01479                // Make link:
01480             if ($this->I['val']['RO']) {
01481                $this->I['theName'] = $this->imgNamePrefix.$this->I['uid'].$this->I['INPfix'];
01482                $over='';
01483                $out ='';
01484                if ($this->I['val']['beforeROImg']) {
01485                   $over.= $this->WMfreezePrefix."over('".$this->I['theName']."before');";
01486                   $out.= $this->WMfreezePrefix."out('".$this->I['theName']."before');";
01487                }
01488                if ($this->I['val']['afterROImg'])  {
01489                   $over.= $this->WMfreezePrefix."over('".$this->I['theName']."after');";
01490                   $out.= $this->WMfreezePrefix."out('".$this->I['theName']."after');";
01491                }
01492                $this->I['linkHREF']['onMouseover']=$over;
01493                $this->I['linkHREF']['onMouseout']=$out;
01494                if ($over || $out)   $GLOBALS['TSFE']->setJS('mouseOver');
01495 
01496                   // Change background color:
01497                if ($this->I['val']['RO_chBgColor'])   {
01498                   $this->addJScolorShiftFunction();
01499                   $chBgP = t3lib_div::trimExplode('|',$this->I['val']['RO_chBgColor']);
01500                   $this->I['linkHREF']['onMouseover'].="changeBGcolor('".$chBgP[2].$this->I['uid']."','".$chBgP[0]."');";
01501                   $this->I['linkHREF']['onMouseout'].="changeBGcolor('".$chBgP[2].$this->I['uid']."','".$chBgP[1]."');";
01502                }
01503 
01504                $this->extProc_RO($key);
01505             }
01506 
01507 
01508                // Calling extra processing function
01509             $this->extProc_beforeLinking($key);
01510 
01511                // Compile link tag
01512             if (!$this->I['val']['doNotLinkIt']) {$this->I['val']['doNotLinkIt']=0;}
01513             if (!$this->I['spacer'] && $this->I['val']['doNotLinkIt']!=1)  {
01514                $this->setATagParts();
01515             } else {
01516                $this->I['A1'] = '';
01517                $this->I['A2'] = '';
01518             }
01519 
01520                // ATAGBeforeWrap processing:
01521             if ($this->I['val']['ATagBeforeWrap']) {
01522                $wrapPartsBefore = explode('|',$this->I['val']['linkWrap']);
01523                $wrapPartsAfter = array('','');
01524             } else {
01525                $wrapPartsBefore = array('','');
01526                $wrapPartsAfter = explode('|',$this->I['val']['linkWrap']);
01527             }
01528             if ($this->I['val']['stdWrap2'] || isset($this->I['val']['stdWrap2.'])) {
01529                $wrapPartsStdWrap = explode($this->I['val']['stdWrap2']?$this->I['val']['stdWrap2']:'|',$this->WMcObj->stdWrap('|',$this->I['val']['stdWrap2.']));
01530             } else {$wrapPartsStdWrap = array('','');}
01531 
01532                // Make before, middle and after parts
01533             $this->I['parts'] = array();
01534             $this->I['parts']['before']=$this->getBeforeAfter('before');
01535             $this->I['parts']['stdWrap2_begin']=$wrapPartsStdWrap[0];
01536             if (!$this->I['val']['doNotShowLink']) {
01537                $this->I['parts']['notATagBeforeWrap_begin'] = $wrapPartsAfter[0];
01538                $this->I['parts']['ATag_begin'] = $this->I['A1'];
01539                $this->I['parts']['ATagBeforeWrap_begin'] = $wrapPartsBefore[0];
01540                $this->I['parts']['title'] = $this->I['title'];
01541                $this->I['parts']['ATagBeforeWrap_end'] = $wrapPartsBefore[1];
01542                $this->I['parts']['ATag_end'] = $this->I['A2'];
01543                $this->I['parts']['notATagBeforeWrap_end'] = $wrapPartsAfter[1];
01544             }
01545             $this->I['parts']['stdWrap2_end']=$wrapPartsStdWrap[1];
01546             $this->I['parts']['after']=$this->getBeforeAfter('after');
01547 
01548                // Passing I to a user function
01549             if ($this->mconf['IProcFunc'])   {
01550                $this->I = $this->userProcess('IProcFunc',$this->I);
01551             }
01552 
01553                // Merge parts + beforeAllWrap
01554             $this->I['theItem']= implode('',$this->I['parts']);
01555             $this->I['theItem']= $this->extProc_beforeAllWrap($this->I['theItem'],$key);
01556 
01557                // allWrap:
01558             $allWrap = $this->WMcObj->stdWrap($this->I['val']['allWrap'],$this->I['val']['allWrap.']);
01559             $this->I['theItem'] = $this->tmpl->wrap($this->I['theItem'],$allWrap);
01560 
01561             if ($this->I['val']['subst_elementUid'])  $this->I['theItem'] = str_replace('{elementUid}',$this->I['uid'],$this->I['theItem']);
01562 
01563                // allStdWrap:
01564             if (is_array($this->I['val']['allStdWrap.']))   {
01565                $this->I['theItem'] = $this->WMcObj->stdWrap($this->I['theItem'],$this->I['val']['allStdWrap.']);
01566             }
01567 
01568                // Calling extra processing function
01569             $this->extProc_afterLinking($key);
01570          }
01571          return $this->extProc_finish();
01572       }
01573    }


The documentation for this class was generated from the following file:
Generated on Sun Oct 3 01:07:46 2004 for TYPO3core 3.7.0 dev by  doxygen 1.3.8-20040913