[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_menus/src/Helper/ -> MenusHelper.php (summary)

(no description)

Copyright: (C) 2017 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 901 lines (32 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

MenusHelper:: (14 methods):
  getLinkKey()
  getMenuTypes()
  getMenuLinks()
  getAssociations()
  getMenuItems()
  installPreset()
  installPresetItems()
  addPreset()
  getPresets()
  loadPreset()
  resolveAlias()
  preprocess()
  loadXml()
  parseXmlNode()


Class: MenusHelper  - X-Ref

Menus component helper.

getLinkKey($request)   X-Ref
Gets a standard form of a link for lookups.

param: mixed  $request  A link string or array of request variables.
return: mixed  A link in standard option-view-layout form, or false if the supplied response is invalid.

getMenuTypes($clientId = 0)   X-Ref
Get the menu list for create a menu module

param: int  $clientId  Optional client id - viz 0 = site, 1 = administrator, can be NULL for all
return: array  The menu array list

getMenuLinks($menuType = null, $parentId = 0, $mode = 0, $published = array()   X-Ref
Get a list of menu links for one or all menus.

param: string   $menuType   An option menu to filter the list on, otherwise all menu with given client id links
param: integer  $parentId   An optional parent ID to pivot results around.
param: integer  $mode       An optional mode. If parent ID is set and mode=2, the parent and children are excluded from the list.
param: array    $published  An optional array of states
param: array    $languages  Optional array of specify which languages we want to filter
param: int      $clientId   Optional client id - viz 0 = site, 1 = administrator, can be NULL for all (used only if menutype not given)
return: array|boolean

getAssociations($pk)   X-Ref
Get the associations

param: integer  $pk  Menu item id
return: array

getMenuItems($menutype, $enabledOnly = false, $exclude = array()   X-Ref
Load the menu items from database for the given menutype

param: string   $menutype     The selected menu type
param: boolean  $enabledOnly  Whether to load only enabled/published menu items.
param: int[]    $exclude      The menu items to exclude from the list
return: AdministratorMenuItem  A root node with the menu items as children

installPreset($preset, $menutype)   X-Ref
Method to install a preset menu into database and link them to the given menutype

param: string  $preset    The preset name
param: string  $menutype  The target menutype
return: void

installPresetItems($node, $menutype)   X-Ref
Method to install a preset menu item into database and link it to the given menutype

param: AdministratorMenuItem  $node      The parent node of the items to process
param: string                 $menutype  The target menutype
return: void

addPreset($name, $title, $path, $replace = true)   X-Ref
Add a custom preset externally via plugin or any other means.
WARNING: Presets with same name will replace previously added preset *except* Joomla's default preset (joomla)

param: string  $name     The unique identifier for the preset.
param: string  $title    The display label for the preset.
param: string  $path     The path to the preset file.
param: bool    $replace  Whether to replace the preset with the same name if any (except 'joomla').
return: void

getPresets()   X-Ref
Get a list of available presets.

return: \stdClass[]

loadPreset($name, $fallback = true, $parent = null)   X-Ref
Load the menu items from a preset file into a hierarchical list of objects

param: string                 $name      The preset name
param: bool                   $fallback  Fallback to default (joomla) preset if the specified one could not be loaded?
param: AdministratorMenuItem  $parent    Root node of the menu
return: AdministratorMenuItem

resolveAlias(&$item)   X-Ref
Method to resolve the menu item alias type menu item

param: AdministratorMenuItem  &$item  The alias object
return: void

preprocess($item)   X-Ref
Parse the flat list of menu items and prepare the hierarchy of them using parent-child relationship.

param: AdministratorMenuItem  $item  Menu item to preprocess
return: void

loadXml($elements, $parent, $replace = array()   X-Ref
Load a menu tree from an XML file

param: \SimpleXMLElement[]    $elements  The xml menuitem nodes
param: AdministratorMenuItem  $parent    The menu hierarchy list to be populated
param: string[]               $replace   The substring replacements for iterator type items
return: void

parseXmlNode($node, $replace = array()   X-Ref
Create a menu item node from an xml element

param: \SimpleXMLElement  $node     A menuitem element from preset xml
param: string[]           $replace  The values to substitute in the title, link and element texts
return: \stdClass



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer