![]() |
TYPO3
7.6
|
Public Member Functions | |
start ($tmpl, $sys_page, $id, $conf, $menuNumber, $objSuffix= '') | |
makeMenu () | |
generate () | |
writeMenu () | |
filterMenuPages (&$data, $banUidArray, $spacer) | |
procesItemStates ($splitCount) | |
link ($key, $altTarget= '', $typeOverride= '') | |
changeLinksForAccessRestrictedPages (&$LD, $page, $mainTarget, $typeOverride) | |
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 () | |
menuTypoLink ($page, $oTarget, $no_cache, $script, $overrideArray= '', $addParams= '', $typeOverride= '') | |
getSysPage () | |
getParentContentObject () | |
Public Attributes | |
$menuNumber = 1 | |
$entryLevel = 0 | |
$spacerIDList = '199' | |
$doktypeExcludeList = '6' | |
$alwaysActivePIDlist = array() | |
$imgNamePrefix = 'img' | |
$imgNameNotRandom = 0 | |
$debug = 0 | |
$parent_cObj = null | |
$GMENU_fixKey = 'gmenu' | |
$MP_array = array() | |
$conf = array() | |
$mconf = array() | |
$tmpl = null | |
$sys_page = null | |
$id | |
$nextActive | |
$menuArr | |
$hash | |
$result = array() | |
$rL_uidRegister = '' | |
$INPfixMD5 | |
$I | |
$WMresult | |
$WMfreezePrefix | |
$WMmenuItems | |
$WMsubmenuObjSuffixes | |
$WMextraScript | |
$WMcObj = null | |
$alternativeMenuTempArray = '' | |
$nameAttribute = 'name' | |
Protected Member Functions | |
removeInaccessiblePages (array $pages) | |
prepareMenuItemsForUserSpecificMenu ($specialValue, $sortingField) | |
prepareMenuItemsForLanguageMenu ($specialValue) | |
prepareMenuItemsForDirectoryMenu ($specialValue, $sortingField) | |
prepareMenuItemsForUpdatedMenu ($specialValue, $sortingField) | |
prepareMenuItemsForKeywordsMenu ($specialValue, $sortingField) | |
prepareMenuItemsForRootlineMenu () | |
prepareMenuItemsForBrowseMenu ($specialValue, $sortingField, $additionalWhere) | |
determineOriginalShortcutPage (array $page) | |
sectionIndex ($altSortField, $pid=null) | |
getDatabaseConnection () | |
getTypoScriptFrontendController () | |
getTimeTracker () | |
getCache () | |
Protected Attributes | |
$useCacheHash = false | |
Generating navigation/menus from TypoScript
The HMENU content object uses this (or more precisely one of the extension classes). Among others the class generates an array of menu items. Thereafter functions from the subclasses are called. The class is always used through extension classes (like GraphicalMenuContentObject or TextMenuContentObject).
Definition at line 37 of file AbstractMenuContentObject.php.
accessKey | ( | $title | ) |
Creates an access-key for a TMENU/GMENU menu item based on the menu item titles first letter
string | $title | Menu item title. |
Definition at line 1939 of file AbstractMenuContentObject.php.
Referenced by TextMenuContentObject\writeMenu(), and GraphicalMenuContentObject\writeMenu().
changeLinksForAccessRestrictedPages | ( | & | $LD, |
$page, | |||
$mainTarget, | |||
$typeOverride | |||
) |
Will change $LD (passed by reference) if the page is access restricted
array | $LD | The array from the linkData() function |
array | $page | Page array |
string | $mainTarget | Main target value |
string | $typeOverride | Type number override if any |
Definition at line 1703 of file AbstractMenuContentObject.php.
Referenced by JavaScriptMenuContentObject\generate_level(), and AbstractMenuContentObject\link().
|
protected |
Determines original shortcut destination in page overlays.
Since the pages records used for menu rendering are overlaid by default, the original 'shortcut' value is lost, if a translation did not define one. The behaviour in TSFE can be compared to the 'mergeIfNotBlank' feature, but it's hardcoded there and not related to the mentioned setting at all.
array | $page |
Definition at line 1673 of file AbstractMenuContentObject.php.
Referenced by AbstractMenuContentObject\link().
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.
array | $data | Array of menu items |
array | $banUidArray | Array of page uids which are to be excluded |
bool | $spacer | If set, then the page is a spacer. |
\UnexpectedValueException |
Definition at line 1195 of file AbstractMenuContentObject.php.
References $GLOBALS, AbstractMenuContentObject\getTypoScriptFrontendController(), GeneralUtility\getUserObj(), GeneralUtility\hideIfNotTranslated(), if, ArrayUtility\inArray(), and GeneralUtility\inList().
Referenced by AbstractMenuContentObject\makeMenu(), and AbstractMenuContentObject\removeInaccessiblePages().
generate | ( | ) |
Generates the the menu data.
Subclasses should overwrite this method.
Definition at line 508 of file AbstractMenuContentObject.php.
Referenced by AbstractMenuContentObject\makeMenu().
getBannedUids | ( | ) |
Returns an array of banned UIDs (from excludeUidList)
Definition at line 2042 of file AbstractMenuContentObject.php.
References GeneralUtility\intExplode().
Referenced by JavaScriptMenuContentObject\generate_level(), AbstractMenuContentObject\makeMenu(), and AbstractMenuContentObject\removeInaccessiblePages().
|
protected |
Definition at line 2221 of file AbstractMenuContentObject.php.
References GeneralUtility\makeInstance().
Referenced by AbstractMenuContentObject\makeMenu().
|
protected |
Definition at line 2197 of file AbstractMenuContentObject.php.
References $GLOBALS.
Referenced by AbstractMenuContentObject\prepareMenuItemsForDirectoryMenu(), AbstractMenuContentObject\prepareMenuItemsForKeywordsMenu(), AbstractMenuContentObject\prepareMenuItemsForUpdatedMenu(), and AbstractMenuContentObject\start().
getDoktypeExcludeWhere | ( | ) |
Returns where clause part to exclude 'not in menu' pages
Definition at line 2031 of file AbstractMenuContentObject.php.
Referenced by AbstractMenuContentObject\prepareMenuItemsForBrowseMenu(), AbstractMenuContentObject\prepareMenuItemsForKeywordsMenu(), and AbstractMenuContentObject\prepareMenuItemsForUpdatedMenu().
getMPvar | ( | $key | ) |
Return MPvar string for entry $key in ->menuArr
int | $key | Pointer to element in ->menuArr |
Definition at line 2012 of file AbstractMenuContentObject.php.
References $GLOBALS.
Referenced by AbstractMenuContentObject\link().
getPageTitle | ( | $title, | |
$nav_title | |||
) |
Returns the title for the navigation
string | $title | The current page title |
string | $nav_title | The current value of the navigation title |
Definition at line 2000 of file AbstractMenuContentObject.php.
Referenced by TextMenuContentObject\writeMenu(), and GraphicalMenuContentObject\writeMenu().
getParentContentObject | ( | ) |
Returns the parent content object
Definition at line 2189 of file AbstractMenuContentObject.php.
getSysPage | ( | ) |
Returns the sys_page object
Definition at line 2179 of file AbstractMenuContentObject.php.
Referenced by AbstractMenuContentObject\link().
|
protected |
Definition at line 2213 of file AbstractMenuContentObject.php.
References $GLOBALS.
Referenced by AbstractMenuContentObject\start().
|
protected |
Definition at line 2205 of file AbstractMenuContentObject.php.
References $GLOBALS.
Referenced by AbstractMenuContentObject\filterMenuPages(), GraphicalMenuContentObject\generate(), JavaScriptMenuContentObject\generate_level(), AbstractMenuContentObject\link(), GraphicalMenuContentObject\makeGifs(), AbstractMenuContentObject\makeMenu(), AbstractMenuContentObject\prepareMenuItemsForBrowseMenu(), AbstractMenuContentObject\prepareMenuItemsForDirectoryMenu(), AbstractMenuContentObject\prepareMenuItemsForKeywordsMenu(), AbstractMenuContentObject\prepareMenuItemsForLanguageMenu(), AbstractMenuContentObject\prepareMenuItemsForUpdatedMenu(), AbstractMenuContentObject\start(), ImageMenuContentObject\writeMenu(), and GraphicalMenuContentObject\writeMenu().
isActive | ( | $uid, | |
$MPvar = '' |
|||
) |
Returns TRUE if the page with UID $uid is active (in the current rootline)
int | $uid | Page uid to evaluate. |
string | $MPvar | MPvar for the current position of item. |
Definition at line 1810 of file AbstractMenuContentObject.php.
Referenced by JavaScriptMenuContentObject\generate_level(), and AbstractMenuContentObject\link().
isCurrent | ( | $uid, | |
$MPvar = '' |
|||
) |
Returns TRUE if the page with UID $uid is the CURRENT page (equals $this->getTypoScriptFrontendController()->id)
int | $uid | Page uid to evaluate. |
string | $MPvar | MPvar for the current position of item. |
Definition at line 1831 of file AbstractMenuContentObject.php.
isItemState | ( | $kind, | |
$key | |||
) |
Used by procesItemStates() to evaluate if a menu item (identified by $key) is in a certain state.
string | $kind | The item state to evaluate (SPC, IFSUB, ACT etc... but no xxxRO states of course) |
int | $key | Key pointing to menu item from ->menuArr |
Definition at line 1896 of file AbstractMenuContentObject.php.
Referenced by AbstractMenuContentObject\procesItemStates().
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)
int | $uid | Page uid to evaluate. |
string | $MPvar | MPvar for the current position of item. |
Definition at line 1789 of file AbstractMenuContentObject.php.
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
int | $uid | Page uid for which to search for a submenu |
Definition at line 1845 of file AbstractMenuContentObject.php.
References GeneralUtility\hideIfDefaultLanguage(), GeneralUtility\hideIfNotTranslated(), and GeneralUtility\inList().
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!!!
int | $key | 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 | $altTarget | Alternative target |
string | $typeOverride | Alternative type |
Definition at line 1529 of file AbstractMenuContentObject.php.
References AbstractMenuContentObject\$conf, $url, AbstractMenuContentObject\changeLinksForAccessRestrictedPages(), AbstractMenuContentObject\determineOriginalShortcutPage(), PageRepository\DOKTYPE_LINK, PageRepository\DOKTYPE_SHORTCUT, elseif, AbstractMenuContentObject\getMPvar(), AbstractMenuContentObject\getSysPage(), AbstractMenuContentObject\getTypoScriptFrontendController(), AbstractMenuContentObject\isActive(), AbstractMenuContentObject\menuTypoLink(), GeneralUtility\quoteJSvalue(), PageRepository\SHORTCUT_MODE_RANDOM_SUBPAGE, and GeneralUtility\validEmail().
Referenced by TextMenuContentObject\writeMenu(), and GraphicalMenuContentObject\writeMenu().
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.
Definition at line 409 of file AbstractMenuContentObject.php.
References AbstractMenuContentObject\filterMenuPages(), AbstractMenuContentObject\generate(), AbstractMenuContentObject\getBannedUids(), AbstractMenuContentObject\getCache(), AbstractMenuContentObject\getTypoScriptFrontendController(), GeneralUtility\inList(), and AbstractMenuContentObject\userProcess().
menuTypoLink | ( | $page, | |
$oTarget, | |||
$no_cache, | |||
$script, | |||
$overrideArray = '' , |
|||
$addParams = '' , |
|||
$typeOverride = '' |
|||
) |
Calls typolink to create menu item links.
array | $page | Page record (uid points where to link to) |
string | $oTarget | Target frame/window |
bool | $no_cache | TRUE if caching should be disabled |
string | $script | Alternative script name (unused) |
array | string | $overrideArray | Array to override values in $page, empty string to skip override |
string | $addParams | Parameters to add to URL |
int | string | $typeOverride | "type" value, empty string means "not set" |
Definition at line 2068 of file AbstractMenuContentObject.php.
References MathUtility\canBeInterpretedAsInteger(), and elseif.
Referenced by JavaScriptMenuContentObject\generate_level(), and AbstractMenuContentObject\link().
|
protected |
Fetches all menuitems if special = browse is set
string | $specialValue | The value from special.value |
string | $sortingField | The sorting field |
string | $additionalWhere | Additional WHERE clause |
Definition at line 1053 of file AbstractMenuContentObject.php.
References AbstractMenuContentObject\$nextActive, AbstractMenuContentObject\getDoktypeExcludeWhere(), AbstractMenuContentObject\getTypoScriptFrontendController(), GeneralUtility\intExplode(), and AbstractMenuContentObject\removeInaccessiblePages().
|
protected |
Fetches all menuitems if special = directory is set
string | $specialValue | The value from special.value |
string | $sortingField | The sorting field |
Definition at line 696 of file AbstractMenuContentObject.php.
References AbstractMenuContentObject\$id, AbstractMenuContentObject\getDatabaseConnection(), AbstractMenuContentObject\getTypoScriptFrontendController(), and GeneralUtility\intExplode().
|
protected |
Fetches all menuitems if special = keywords is set
string | $specialValue | The value from special.value |
string | $sortingField | The sorting field |
Definition at line 902 of file AbstractMenuContentObject.php.
References MathUtility\canBeInterpretedAsInteger(), MathUtility\forceIntegerInRange(), AbstractMenuContentObject\getDatabaseConnection(), AbstractMenuContentObject\getDoktypeExcludeWhere(), AbstractMenuContentObject\getTypoScriptFrontendController(), if, and GeneralUtility\intExplode().
|
protected |
Fetches all menuitems if special = language is set
string | $specialValue | The value from special.value |
Definition at line 641 of file AbstractMenuContentObject.php.
References $languageItems, AbstractMenuContentObject\getTypoScriptFrontendController(), GeneralUtility\hideIfNotTranslated(), and GeneralUtility\intExplode().
|
protected |
Fetches all menuitems if special = rootline is set
Definition at line 997 of file AbstractMenuContentObject.php.
References MathUtility\canBeInterpretedAsInteger().
|
protected |
Fetches all menuitems if special = updated is set
string | $specialValue | The value from special.value |
string | $sortingField | The sorting field |
Definition at line 825 of file AbstractMenuContentObject.php.
References $GLOBALS, AbstractMenuContentObject\$id, MathUtility\canBeInterpretedAsInteger(), MathUtility\forceIntegerInRange(), AbstractMenuContentObject\getDatabaseConnection(), AbstractMenuContentObject\getDoktypeExcludeWhere(), AbstractMenuContentObject\getTypoScriptFrontendController(), and GeneralUtility\intExplode().
|
protected |
Fetches all menuitems if special = userfunction is set
string | $specialValue | The value from special.value |
string | $sortingField | The sorting field |
Definition at line 622 of file AbstractMenuContentObject.php.
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.
int | $splitCount | Number of menu items in the menu |
Definition at line 1269 of file AbstractMenuContentObject.php.
References AbstractMenuContentObject\isItemState().
Referenced by TextMenuContentObject\generate(), GraphicalMenuContentObject\generate(), and ImageMenuContentObject\generate().
|
protected |
Gets an array of page rows and removes all, which are not accessible
array | $pages |
Definition at line 526 of file AbstractMenuContentObject.php.
References PageRepository\DOKTYPE_SPACER, AbstractMenuContentObject\filterMenuPages(), and AbstractMenuContentObject\getBannedUids().
Referenced by AbstractMenuContentObject\prepareMenuItemsForBrowseMenu().
|
protected |
Generates a list of content objects with sectionIndex enabled available on a specific page
Used for menus with sectionIndex enabled
string | $altSortField | Alternative sorting field |
int | $pid | The page id to search for sections |
\UnexpectedValueException | if the query to fetch the content elements unexpectedly fails |
Definition at line 2108 of file AbstractMenuContentObject.php.
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'])
Definition at line 1984 of file AbstractMenuContentObject.php.
References GeneralUtility\implodeAttributes().
Referenced by TextMenuContentObject\writeMenu(), and GraphicalMenuContentObject\writeMenu().
start | ( | $tmpl, | |
$sys_page, | |||
$id, | |||
$conf, | |||
$menuNumber, | |||
$objSuffix = '' |
|||
) |
The initialization of the object. This just sets some internal variables.
TemplateService | $tmpl | The $this->getTypoScriptFrontendController()->tmpl object |
PageRepository | $sys_page | The $this->getTypoScriptFrontendController()->sys_page object |
int | string | $id | A starting point page id. This should probably be blank since the 'entryLevel' value will be used then. |
array | $conf | The TypoScript configuration for the HMENU cObject |
int | $menuNumber | Menu number; 1,2,3. Should probably be 1 |
string | $objSuffix | 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") |
Definition at line 244 of file AbstractMenuContentObject.php.
References AbstractMenuContentObject\$conf, AbstractMenuContentObject\$entryLevel, AbstractMenuContentObject\$id, AbstractMenuContentObject\$menuNumber, AbstractMenuContentObject\$MP_array, AbstractMenuContentObject\$sys_page, AbstractMenuContentObject\$tmpl, debug(), AbstractMenuContentObject\getDatabaseConnection(), AbstractMenuContentObject\getTimeTracker(), AbstractMenuContentObject\getTypoScriptFrontendController(), GeneralUtility\intExplode(), and GeneralUtility\makeInstance().
userProcess | ( | $mConfKey, | |
$passVar | |||
) |
Calls a user function for processing of internal data. Used for the properties "IProcFunc" and "itemArrayProcFunc"
string | $mConfKey | 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 | $passVar | 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 |
Definition at line 1968 of file AbstractMenuContentObject.php.
Referenced by AbstractMenuContentObject\makeMenu(), TextMenuContentObject\writeMenu(), and GraphicalMenuContentObject\writeMenu().
writeMenu | ( | ) |
Definition at line 515 of file AbstractMenuContentObject.php.
$alternativeMenuTempArray = '' |
Definition at line 215 of file AbstractMenuContentObject.php.
$alwaysActivePIDlist = array() |
Definition at line 70 of file AbstractMenuContentObject.php.
$conf = array() |
Definition at line 111 of file AbstractMenuContentObject.php.
Referenced by GraphicalMenuContentObject\findLargestDims(), AbstractMenuContentObject\link(), GraphicalMenuContentObject\makeGifs(), and AbstractMenuContentObject\start().
$debug = 0 |
Definition at line 85 of file AbstractMenuContentObject.php.
$doktypeExcludeList = '6' |
Definition at line 65 of file AbstractMenuContentObject.php.
$entryLevel = 0 |
Definition at line 51 of file AbstractMenuContentObject.php.
Referenced by AbstractMenuContentObject\start().
$GMENU_fixKey = 'gmenu' |
Definition at line 97 of file AbstractMenuContentObject.php.
$hash |
Definition at line 155 of file AbstractMenuContentObject.php.
$I |
Definition at line 178 of file AbstractMenuContentObject.php.
$id |
Definition at line 135 of file AbstractMenuContentObject.php.
Referenced by AbstractMenuContentObject\prepareMenuItemsForDirectoryMenu(), AbstractMenuContentObject\prepareMenuItemsForUpdatedMenu(), and AbstractMenuContentObject\start().
$imgNameNotRandom = 0 |
Definition at line 80 of file AbstractMenuContentObject.php.
$imgNamePrefix = 'img' |
Definition at line 75 of file AbstractMenuContentObject.php.
$INPfixMD5 |
Definition at line 173 of file AbstractMenuContentObject.php.
Referenced by TextMenuContentObject\writeMenu(), and GraphicalMenuContentObject\writeMenu().
$mconf = array() |
Definition at line 118 of file AbstractMenuContentObject.php.
$menuArr |
Definition at line 150 of file AbstractMenuContentObject.php.
$menuNumber = 1 |
Definition at line 44 of file AbstractMenuContentObject.php.
Referenced by AbstractMenuContentObject\start().
$MP_array = array() |
Definition at line 104 of file AbstractMenuContentObject.php.
Referenced by JavaScriptMenuContentObject\generate_level(), and AbstractMenuContentObject\start().
$nameAttribute = 'name' |
Definition at line 222 of file AbstractMenuContentObject.php.
$nextActive |
Definition at line 143 of file AbstractMenuContentObject.php.
Referenced by AbstractMenuContentObject\prepareMenuItemsForBrowseMenu().
$parent_cObj = null |
Definition at line 92 of file AbstractMenuContentObject.php.
$result = array() |
Definition at line 160 of file AbstractMenuContentObject.php.
Referenced by ImageMenuContentObject\writeMenu().
$rL_uidRegister = '' |
Definition at line 168 of file AbstractMenuContentObject.php.
$spacerIDList = '199' |
Definition at line 58 of file AbstractMenuContentObject.php.
$sys_page = null |
Definition at line 128 of file AbstractMenuContentObject.php.
Referenced by AbstractMenuContentObject\start().
$tmpl = null |
Definition at line 123 of file AbstractMenuContentObject.php.
Referenced by AbstractMenuContentObject\start().
|
protected |
Definition at line 230 of file AbstractMenuContentObject.php.
$WMcObj = null |
Definition at line 208 of file AbstractMenuContentObject.php.
$WMextraScript |
Definition at line 203 of file AbstractMenuContentObject.php.
Referenced by TextMenuContentObject\extProc_finish(), and GraphicalMenuContentObject\extProc_finish().
$WMfreezePrefix |
Definition at line 188 of file AbstractMenuContentObject.php.
$WMmenuItems |
Definition at line 193 of file AbstractMenuContentObject.php.
Referenced by GraphicalMenuContentObject\writeMenu().
$WMresult |
Definition at line 183 of file AbstractMenuContentObject.php.
$WMsubmenuObjSuffixes |
Definition at line 198 of file AbstractMenuContentObject.php.