Documentation TYPO3 par Ameos

tslib_menu Class Reference

Inheritance diagram for tslib_menu:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 start (&$tmpl, &$sys_page, $id, $conf, $menuNumber)
 makeMenu ()
 includeMakeMenu ($conf, $altSortField)
 filterMenuPages (&$data, $banUidArray, $spacer)
 procesItemStates ($splitCount)
 link ($key, $altTarget='', $typeOverride='')
 subMenu ($uid)
 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 ()
 start (&$tmpl, &$sys_page, $id, $conf, $menuNumber)
 makeMenu ()
 includeMakeMenu ($conf, $altSortField)
 filterMenuPages (&$data, $banUidArray, $spacer)
 procesItemStates ($splitCount)
 link ($key, $altTarget='', $typeOverride='')
 subMenu ($uid)
 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 ()

Public Attributes

 $menuNumber = 1
 $entryLevel = 0
 $subLevelClass = ''
 $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
 $WMextraScript
 $alternativeMenuTempArray = ''

Detailed Description

Definition at line 143 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 1303 of file class.tslib_menu.php.

References $result, and accessKey().

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 1303 of file class.tslib_menu.php.

References $result.

Referenced by accessKey().

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 838 of file class.tslib_menu.php.

References t3lib_div::_GP(), t3lib_div::inArray(), and t3lib_div::inList().

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 838 of file class.tslib_menu.php.

References t3lib_div::_GP(), t3lib_div::inArray(), and t3lib_div::inList().

Referenced by makeMenu().

tslib_menu::getDoktypeExcludeWhere  ) 
 

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

Returns:
string where clause part. private

Definition at line 1384 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 1384 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 1369 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 1369 of file class.tslib_menu.php.

Referenced by tslib_tmenu_layers::extProc_beforeLinking(), tslib_gmenu_layers::extProc_beforeLinking(), tslib_gmenu_foldout::extProc_beforeLinking(), isItemState(), link(), and subMenu().

tslib_menu::getPageTitle title,
nav_title
 

Returns the title for the navigation

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

Definition at line 1357 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 naviation title
Returns:
string Returns the navigation title if it is NOT blank, otherwise the page title. private

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

Referenced by tslib_tmenu::writeMenu().

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 depreciated 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 822 of file class.tslib_menu.php.

References $conf.

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 depreciated 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 822 of file class.tslib_menu.php.

References $conf.

Referenced by makeMenu().

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 1205 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 1205 of file class.tslib_menu.php.

Referenced by tslib_tmenu_layers::extProc_beforeLinking(), tslib_gmenu_layers::extProc_beforeLinking(), tslib_gmenu_foldout::extProc_beforeLinking(), isItemState(), and link().

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 1226 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 1226 of file class.tslib_menu.php.

Referenced by isItemState().

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 1266 of file class.tslib_menu.php.

References getMPvar(), isActive(), isCurrent(), and isSubMenu().

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 1266 of file class.tslib_menu.php.

References getMPvar(), isActive(), isCurrent(), and isSubMenu().

Referenced by procesItemStates().

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 1184 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 1184 of file class.tslib_menu.php.

Referenced by subMenu().

tslib_menu::isSubMenu uid  ) 
 

Returns true if there is a submenu with items for the page id, $uid Used by the item states "IFSUB" and "ACTIFSUB" 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 1241 of file class.tslib_menu.php.

References t3lib_div::inList().

tslib_menu::isSubMenu uid  ) 
 

Returns true if there is a submenu with items for the page id, $uid Used by the item states "IFSUB" and "ACTIFSUB" 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 1241 of file class.tslib_menu.php.

References t3lib_div::inList().

Referenced by isItemState().

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 1082 of file class.tslib_menu.php.

References $conf, getMPvar(), and isActive().

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 1082 of file class.tslib_menu.php.

References $conf, getMPvar(), and isActive().

Referenced by tslib_tmenu::writeMenu().

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 313 of file class.tslib_menu.php.

References $id, $nextActive, tslib_cObj::calc(), tslib_cObj::enableFields(), filterMenuPages(), tslib_cObj::getKey(), tslib_cObj::getTreeList(), includeMakeMenu(), t3lib_div::inList(), t3lib_div::intExplode(), t3lib_div::intInRange(), tslib_cObj::keywords(), t3lib_div::makeInstance(), t3lib_div::testInt(), and userProcess().

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 313 of file class.tslib_menu.php.

References $id, $nextActive, tslib_cObj::calc(), tslib_cObj::enableFields(), filterMenuPages(), tslib_cObj::getKey(), tslib_cObj::getTreeList(), includeMakeMenu(), t3lib_div::inList(), t3lib_div::intExplode(), t3lib_div::intInRange(), tslib_cObj::keywords(), t3lib_div::makeInstance(), t3lib_div::testInt(), and userProcess().

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 894 of file class.tslib_menu.php.

References isItemState().

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 894 of file class.tslib_menu.php.

References isItemState().

Referenced by tslib_imgmenu::generate(), and tslib_tmenu::generate().

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 1344 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 1344 of file class.tslib_menu.php.

Referenced by tslib_tmenu::writeMenu().

tslib_menu::start &$  tmpl,
&$  sys_page,
id,
conf,
menuNumber
 

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'
Returns:
boolean Returns true on success
See also:
tslib_cObj::HMENU()

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

References $conf, $entryLevel, $id, $menuNumber, $sys_page, $tmpl, tslib_cObj::getKey(), t3lib_div::inList(), t3lib_div::intExplode(), t3lib_div::removeArrayEntryByValue(), and t3lib_div::trimExplode().

tslib_menu::start &$  tmpl,
&$  sys_page,
id,
conf,
menuNumber
 

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'
Returns:
boolean Returns true on success
See also:
tslib_cObj::HMENU()

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

References $conf, $entryLevel, $id, $menuNumber, $sys_page, $tmpl, tslib_cObj::getKey(), t3lib_div::inList(), t3lib_div::intExplode(), t3lib_div::removeArrayEntryByValue(), and t3lib_div::trimExplode().

Referenced by subMenu().

tslib_menu::subMenu uid  ) 
 

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)
Returns:
string HTML content of the submenu private

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

References getMPvar(), isNext(), t3lib_div::makeInstance(), and start().

tslib_menu::subMenu uid  ) 
 

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)
Returns:
string HTML content of the submenu private

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

References getMPvar(), isNext(), t3lib_div::makeInstance(), and start().

Referenced by tslib_tmenu_layers::extProc_beforeLinking(), tslib_gmenu_layers::extProc_beforeLinking(), and tslib_gmenu_foldout::extProc_beforeLinking().

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 1329 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 1329 of file class.tslib_menu.php.

Referenced by makeMenu(), and tslib_tmenu::writeMenu().


The documentation for this class was generated from the following files:


Généré par Les spécialistes TYPO3 avec  doxygen 1.4.6