tslib_menu Class Reference

Inheritance diagram for tslib_menu:

tslib_gmenu tslib_imgmenu tslib_jsmenu tslib_tmenu tslib_gmenu_foldout tslib_gmenu_layers tslib_tmenu_layers List of all members.

Public Member Functions

 start (&$tmpl, &$sys_page, $id, $conf, $menuNumber, $objSuffix='')
 makeMenu ()
 includeMakeMenu ($conf, $altSortField)
 filterMenuPages (&$data, $banUidArray, $spacer)
 procesItemStates ($splitCount)
 link ($key, $altTarget='', $typeOverride='')
 changeLinksForAccessRestrictedPages (&$LD, $page, $mainTarget, $typeOverride)
 subMenu ($uid, $objSuffix='')
 isNext ($uid, $MPvar='')
 isActive ($uid, $MPvar='')
 isCurrent ($uid, $MPvar='')
 isSubMenu ($uid)
 isItemState ($kind, $key)
 accessKey ($title)
 userProcess ($mConfKey, $passVar)
 setATagParts ()
 getPageTitle ($title, $nav_title)
 getMPvar ($key)
 getDoktypeExcludeWhere ()
 getBannedUids ()

Public Attributes

 $menuNumber = 1
 $entryLevel = 0
 $spacerIDList = '199'
 $doktypeExcludeList = '5,6'
 $alwaysActivePIDlist = array()
 $imgNamePrefix = 'img'
 $imgNameNotRandom = 0
 $debug = 0
 $parent_cObj = ''
 $GMENU_fixKey = 'gmenu'
 $MP_array = array()
 $conf = Array()
 $mconf = Array()
 $tmpl
 $sys_page
 $id
 $nextActive
 $menuArr
 $hash
 $result = Array()
 $rL_uidRegister = ''
 $INPfixMD5
 $I
 $WMresult
 $WMfreezePrefix
 $WMmenuItems
 $WMsubmenuObjSuffixes
 $WMextraScript
 $alternativeMenuTempArray = ''
 $nameAttribute = 'name'

Detailed Description

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


Member Function Documentation

tslib_menu.accessKey title  ) 
 

Creates an access-key for a GMENU menu item based on the menu item titles first letter

Parameters:
string Menu item title.
Returns:
array Returns an array with keys "code" ("accesskey" attribute for the img-tag) and "alt" (text-addition to the "alt" attribute) if an access key was defined. Otherwise array was empty private

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

tslib_menu.changeLinksForAccessRestrictedPages &$  LD,
page,
mainTarget,
typeOverride
 

Will change $LD (passed by reference) if the page is access restricted

Parameters:
array $LD, the array from the linkData() function
array Page array
string Main target value
string Type number override if any
Returns:
void ($LD passed by reference might be changed.)

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

tslib_menu.filterMenuPages &$  data,
banUidArray,
spacer
 

Checks if a page is OK to include in the final menu item array. Pages can be excluded if the doktype is wrong, if they are hidden in navigation, have a uid in the list of banned uids etc.

Parameters:
array Array of menu items
array Array of page uids which are to be excluded
boolean If set, then the page is a spacer.
Returns:
boolean Returns true if the page can be safely included.

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

tslib_menu.getBannedUids  ) 
 

Returns an array of banned UIDs (from excludeUidList)

Returns:
array Array of banned UIDs private

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

tslib_menu.getDoktypeExcludeWhere  ) 
 

Returns where clause part to exclude 'not in menu' pages

Returns:
string where clause part. private

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

tslib_menu.getMPvar key  ) 
 

Return MPvar string for entry $key in ->menuArr

Parameters:
integer Pointer to element in ->menuArr
string Implode token.
Returns:
string MP vars for element.
See also:
link()

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

tslib_menu.getPageTitle title,
nav_title
 

Returns the title for the navigation

Parameters:
string The current page title
string The current value of the navigation title
Returns:
string Returns the navigation title if it is NOT blank, otherwise the page title. private

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

tslib_menu.includeMakeMenu conf,
altSortField
 

Includes the PHP script defined for the HMENU special type "userdefined". This script is supposed to populate the array $menuItemsArray with a set of page records comprising the menu. The "userdefined" type is deprecated since "userfunction" has arrived since and is a better choice for many reasons (like using classes/functions for rendering the menu)

Parameters:
array TypoScript parameters for "special.". In particular the property "file" is reserved and specifies the file to include. Seems like any other property can be used freely by the script.
string The sorting field. Can be used from the script in the $incFile.
Returns:
array An array with the menu items private

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

tslib_menu.isActive uid,
MPvar = ''
 

Returns true if the page with UID $uid is active (in the current rootline)

Parameters:
integer Page uid to evaluate.
string MPvar for the current position of item.
Returns:
boolean True if page with $uid is active private

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

tslib_menu.isCurrent uid,
MPvar = ''
 

Returns true if the page with UID $uid is the CURRENT page (equals $GLOBALS['TSFE']->id)

Parameters:
integer Page uid to evaluate.
string MPvar for the current position of item.
Returns:
boolean True if page $uid = $GLOBALS['TSFE']->id private

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

tslib_menu.isItemState kind,
key
 

Used by procesItemStates() to evaluate if a menu item (identified by $key) is in a certain state.

Parameters:
string The item state to evaluate (SPC, IFSUB, ACT etc... but no xxxRO states of course)
integer Key pointing to menu item from ->menuArr
Returns:
boolean True (integer!=0) if match, otherwise false (=0, zero) private
See also:
procesItemStates()

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

tslib_menu.isNext uid,
MPvar = ''
 

Returns true if the page with UID $uid is the NEXT page in root line (which means a submenu should be drawn)

Parameters:
integer Page uid to evaluate.
string MPvar for the current position of item.
Returns:
boolean True if page with $uid is active private
See also:
subMenu()

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

tslib_menu.isSubMenu uid  ) 
 

Returns true if there is a submenu with items for the page id, $uid Used by the item states "IFSUB", "ACTIFSUB" and "CURIFSUB" to check if there is a submenu

Parameters:
integer Page uid for which to search for a submenu
Returns:
boolean Returns true if there was a submenu with items found private

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

tslib_menu.link key,
altTarget = '',
typeOverride = ''
 

Creates the URL, target and onclick values for the menu item link. Returns them in an array as key/value pairs for -tag attributes This function doesn't care about the url, because if we let the url be redirected, it will be logged in the stat!!!

Parameters:
integer Pointer to a key in the $this->menuArr array where the value for that key represents the menu item we are linking to (page record)
string Alternative target
integer Alternative type
Returns:
array Returns an array with A-tag attributes as key/value pairs (HREF, TARGET and onClick) private

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

tslib_menu.makeMenu  ) 
 

Creates the menu in the internal variables, ready for output. Basically this will read the page records needed and fill in the internal $this->menuArr Based on a hash of this array and some other variables the $this->result variable will be loaded either from cache OR by calling the generate() method of the class to create the menu for real.

Returns:
void

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

tslib_menu.procesItemStates splitCount  ) 
 

Generating the per-menu-item configuration arrays based on the settings for item states (NO, RO, ACT, CUR etc) set in ->mconf (config for the current menu object) Basically it will produce an individual array for each menu item based on the item states. BUT in addition the "optionSplit" syntax for the values is ALSO evaluated here so that all property-values are "option-splitted" and the output will thus be resolved. Is called from the "generate" functions in the extension classes. The function is processor intensive due to the option split feature in particular. But since the generate function is not always called (since the ->result array may be cached, see makeMenu) it doesn't hurt so badly.

Parameters:
integer Number of menu items in the menu
Returns:
array An array with two keys: array($NOconf,$ROconf) - where $NOconf contains the resolved configuration for each item when NOT rolled-over and $ROconf contains the ditto for the mouseover state (if any) private

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

tslib_menu.setATagParts  ) 
 

Creates the tag parts for the current item (in $this->I, [A1] and [A2]) based on other information in this array (like $this->I['linkHREF'])

Returns:
void private

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

tslib_menu.start &$  tmpl,
&$  sys_page,
id,
conf,
menuNumber,
objSuffix = ''
 

The initialization of the object. This just sets some internal variables.

Parameters:
object The $GLOBALS['TSFE']->tmpl object
object The $GLOBALS['TSFE']->sys_page object
integer A starting point page id. This should probably be blank since the 'entryLevel' value will be used then.
array The TypoScript configuration for the HMENU cObject
integer Menu number; 1,2,3. Should probably be '1'
string Submenu Object suffix. This offers submenus a way to use alternative configuration for specific positions in the menu; By default "1 = TMENU" would use "1." for the TMENU configuration, but if this string is set to eg. "a" then "1a." would be used for configuration instead (while "1 = " is still used for the overall object definition of "TMENU")
Returns:
boolean Returns true on success
See also:
tslib_cObj.HMENU()

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

tslib_menu.subMenu uid,
objSuffix = ''
 

Creates a submenu level to the current level - if configured for.

Parameters:
integer Page id of the current page for which a submenu MAY be produced (if conditions are met)
string Object prefix, see ->start()
Returns:
string HTML content of the submenu private

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

tslib_menu.userProcess mConfKey,
passVar
 

Calls a user function for processing of internal data. Used for the properties "IProcFunc" and "itemArrayProcFunc"

Parameters:
string Key pointing for the property in the current ->mconf array holding possibly parameters to pass along to the function/method. Currently the keys used are "IProcFunc" and "itemArrayProcFunc".
mixed A variable to pass to the user function and which should be returned again from the user function. The idea is that the user function modifies this variable according to what you want to achieve and then returns it. For "itemArrayProcFunc" this variable is $this->menuArr, for "IProcFunc" it is $this->I
Returns:
mixed The processed $passVar private

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


Member Data Documentation

tslib_menu.$alternativeMenuTempArray = ''
 

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

tslib_menu.$alwaysActivePIDlist = array()
 

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

tslib_menu.$conf = Array()
 

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

tslib_menu.$debug = 0
 

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

tslib_menu.$doktypeExcludeList = '5,6'
 

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

tslib_menu.$entryLevel = 0
 

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

tslib_menu.$GMENU_fixKey = 'gmenu'
 

Reimplemented in tslib_gmenu_foldout, tslib_gmenu_layers, and tslib_tmenu_layers.

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

tslib_menu.$hash
 

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

tslib_menu.$I
 

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

tslib_menu.$id
 

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

tslib_menu.$imgNameNotRandom = 0
 

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

tslib_menu.$imgNamePrefix = 'img'
 

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

tslib_menu.$INPfixMD5
 

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

tslib_menu.$mconf = Array()
 

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

tslib_menu.$menuArr
 

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

tslib_menu.$menuNumber = 1
 

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

tslib_menu.$MP_array = array()
 

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

tslib_menu.$nameAttribute = 'name'
 

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

tslib_menu.$nextActive
 

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

tslib_menu.$parent_cObj = ''
 

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

tslib_menu.$result = Array()
 

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

tslib_menu.$rL_uidRegister = ''
 

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

tslib_menu.$spacerIDList = '199'
 

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

tslib_menu.$sys_page
 

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

tslib_menu.$tmpl
 

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

tslib_menu.$WMextraScript
 

Reimplemented in tslib_gmenu_layers, and tslib_tmenu_layers.

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

tslib_menu.$WMfreezePrefix
 

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

tslib_menu.$WMmenuItems
 

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

tslib_menu.$WMresult
 

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

tslib_menu.$WMsubmenuObjSuffixes
 

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


The documentation for this class was generated from the following file:
Generated on Fri Apr 7 10:49:38 2006 for TYPO3 by  doxygen 1.4.6