Solutions Open Source

Référence de la classe tslib_menu

Graphe d'héritage de tslib_menu:

Inheritance graph
[légende]

Liste de tous les membres

Fonctions membres publiques

 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 ()

Attributs publics

 $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'


Documentation des fonctions membres

tslib_menu::start ( &$  tmpl,
&$  sys_page,
id,
conf,
menuNumber,
objSuffix = '' 
)

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

Paramètres:
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")
Renvoie:
boolean Returns true on success
Voir également:
tslib_cObj::HMENU()

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.

Renvoie:
void

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)

Paramètres:
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.
Renvoie:
array An array with the menu items private

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.

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

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.

Paramètres:
integer Number of menu items in the menu
Renvoie:
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

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!!!

Paramètres:
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
Renvoie:
array Returns an array with A-tag attributes as key/value pairs (HREF, TARGET and onClick) private

tslib_menu::changeLinksForAccessRestrictedPages ( &$  LD,
page,
mainTarget,
typeOverride 
)

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

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

tslib_menu::subMenu ( uid,
objSuffix = '' 
)

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

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

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)

Paramètres:
integer Page uid to evaluate.
string MPvar for the current position of item.
Renvoie:
boolean True if page with $uid is active private
Voir également:
subMenu()

tslib_menu::isActive ( uid,
MPvar = '' 
)

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

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

tslib_menu::isCurrent ( uid,
MPvar = '' 
)

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

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

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

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

tslib_menu::isItemState ( kind,
key 
)

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

Paramètres:
string The item state to evaluate (SPC, IFSUB, ACT etc... but no xxxRO states of course)
integer Key pointing to menu item from ->menuArr
Renvoie:
boolean True (integer!=0) if match, otherwise false (=0, zero) private
Voir également:
procesItemStates()

tslib_menu::accessKey ( title  ) 

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

Paramètres:
string Menu item title.
Renvoie:
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

tslib_menu::userProcess ( mConfKey,
passVar 
)

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

Paramètres:
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
Renvoie:
mixed The processed $passVar private

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'])

Renvoie:
void private

tslib_menu::getPageTitle ( title,
nav_title 
)

Returns the title for the navigation

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

tslib_menu::getMPvar ( key  ) 

Return MPvar string for entry $key in ->menuArr

Paramètres:
integer Pointer to element in ->menuArr
string Implode token.
Renvoie:
string MP vars for element.
Voir également:
link()

tslib_menu::getDoktypeExcludeWhere (  ) 

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

Renvoie:
string where clause part. private

tslib_menu::getBannedUids (  ) 

Returns an array of banned UIDs (from excludeUidList)

Renvoie:
array Array of banned UIDs private


Documentation des données membres

tslib_menu::$menuNumber = 1

tslib_menu::$entryLevel = 0

tslib_menu::$spacerIDList = '199'

tslib_menu::$doktypeExcludeList = '5,6'

tslib_menu::$alwaysActivePIDlist = array()

tslib_menu::$imgNamePrefix = 'img'

tslib_menu::$imgNameNotRandom = 0

tslib_menu::$debug = 0

tslib_menu::$parent_cObj

tslib_menu::$GMENU_fixKey = 'gmenu'

Réimplémentée dans tslib_gmenu_foldout, tslib_gmenu_layers, et tslib_tmenu_layers.

tslib_menu::$MP_array = array()

tslib_menu::$conf = Array()

tslib_menu::$mconf = Array()

tslib_menu::$tmpl

tslib_menu::$sys_page

tslib_menu::$id

tslib_menu::$nextActive

tslib_menu::$menuArr

tslib_menu::$hash

tslib_menu::$result = Array()

tslib_menu::$rL_uidRegister = ''

tslib_menu::$INPfixMD5

tslib_menu::$I

tslib_menu::$WMresult

tslib_menu::$WMfreezePrefix

tslib_menu::$WMmenuItems

tslib_menu::$WMsubmenuObjSuffixes

tslib_menu::$WMextraScript

Réimplémentée dans tslib_gmenu_layers, et tslib_tmenu_layers.

tslib_menu::$alternativeMenuTempArray = ''

tslib_menu::$nameAttribute = 'name'


La documentation de cette classe a été générée à partir du fichier suivant :
Généré le Fri Aug 31 11:43:27 2007 pour OBLADY - Typo3 API v4.1.2 par  doxygen 1.5.3