Documentation TYPO3 par Ameos

tslib_menu Class Reference

Inheritance diagram for tslib_menu:
[legend]
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::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.

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

Referenced by subMenu().

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.

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

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.

References $conf.

Referenced by makeMenu().

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.

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

Referenced by makeMenu().

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.

References isItemState().

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

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.

References $conf, changeLinksForAccessRestrictedPages(), getMPvar(), isActive(), and t3lib_div::validEmail().

Referenced by tslib_tmenu::writeMenu().

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

Referenced by link(), and tslib_imgmenu::makeImageMap().

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

References getMPvar(), t3lib_div::inList(), 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::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 1286 of file class.tslib_menu.php.

Referenced by subMenu().

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

Referenced by isItemState().

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

References t3lib_div::inList().

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

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

Referenced by procesItemStates().

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

References $result.

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

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

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

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

References accessKey().

Referenced by tslib_tmenu::writeMenu().

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

Referenced by tslib_tmenu::writeMenu().

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 1474 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::getDoktypeExcludeWhere (  ) 

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

Returns:
string where clause part. private

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

Referenced by makeMenu().

tslib_menu::getBannedUids (  ) 

Returns an array of banned UIDs (from excludeUidList)

Returns:
array Array of banned UIDs private

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

References t3lib_div::intExplode().

Referenced by makeMenu().


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


Généré par Les experts TYPO3 avec  doxygen 1.4.6