Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe MenusHelper
+ Graphe d'héritage de MenusHelper:

Fonctions membres publiques statiques

static getLinkKey ($request)
 
static getMenuTypes ($clientId=0)
 
static getMenuLinks ($menuType=null, $parentId=0, $mode=0, $published=array(), $languages=array(), $clientId=0)
 
static getAssociations ($pk)
 
static getMenuItems ($menutype, $enabledOnly=false, $exclude=array())
 
static installPreset ($preset, $menutype)
 
static addPreset ($name, $title, $path, $replace=true)
 
static getPresets ()
 
static loadPreset ($name, $fallback=true, $parent=null)
 
static resolveAlias (&$item)
 
static preprocess ($item)
 
- Fonctions membres publiques statiques hérités de ContentHelper
static addSubmenu ($vName)
 
static countRelations (&$items, $config)
 
static getActions ($component='', $section='', $id=0)
 
static getCurrentLanguage ($detectBrowser=true)
 
static getLanguageId ($langCode)
 

Fonctions membres protégées statiques

static loadXml ($elements, $parent, $replace=array())
 
static parseXmlNode ($node, $replace=array())
 

Attributs protégés statiques

static $_filter = array('option', 'view', 'layout')
 
static $presets = null
 

Membres hérités additionnels

- Fonctions membres publiques hérités de ContentHelper
 getRowData (Table $table)
 

Description détaillée

Menus component helper.

Depuis
1.6

Documentation des fonctions membres

◆ addPreset()

static addPreset (   $name,
  $title,
  $path,
  $replace = true 
)
static

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ètres
string$nameThe unique identifier for the preset.
string$titleThe display label for the preset.
string$pathThe path to the preset file.
bool$replaceWhether to replace the preset with the same name if any (except 'joomla').
Renvoie
void
Depuis
4.0.0

Références $name, $path, $title, et null.

◆ getAssociations()

static getAssociations (   $pk)
static

Get the associations

Paramètres
integer$pkMenu item id
Renvoie
array
Depuis
3.0

Références Associations\getAssociations().

Référencé par Menus\association(), ItemModel\getItem(), LanguagesHelper\getList(), PlgSystemLanguageFilter\onAfterDispatch(), et PlgSystemLanguageFilter\onUserLogin().

◆ getLinkKey()

static getLinkKey (   $request)
static

Gets a standard form of a link for lookups.

Paramètres
mixed$requestA link string or array of request variables.
Renvoie
mixed A link in standard option-view-layout form, or false if the supplied response is invalid.
Depuis
1.6

Références $name, et $value.

Référencé par MenutypesModel\addReverseLookupUrl(), MenutypeField\getInput(), et ItemModel\getItem().

◆ getMenuItems()

static getMenuItems (   $menutype,
  $enabledOnly = false,
  $exclude = array() 
)
static

Load the menu items from database for the given menutype

Paramètres
string$menutypeThe selected menu type
boolean$enabledOnlyWhether to load only enabled/published menu items.
int[]$exclude The menu items to exclude from the list
Renvoie
AdministratorMenuItem A root node with the menu items as children
Depuis
4.0.0

Références $db, $item, $menutype, $query, $root, Text\_(), class, Factory\getApplication(), Factory\getContainer(), null, et ParameterType\STRING.

Référencé par XmlView\display(), CssMenu\load(), Menu\preprocess(), et CssMenu\preprocess().

◆ getMenuLinks()

static getMenuLinks (   $menuType = null,
  $parentId = 0,
  $mode = 0,
  $published = array(),
  $languages = array(),
  $clientId = 0 
)
static

Get a list of menu links for one or all menus.

Paramètres
string$menuTypeAn option menu to filter the list on, otherwise all menu with given client id links are returned as a grouped array.
integer$parentIdAn optional parent ID to pivot results around.
integer$modeAn optional mode. If parent ID is set and mode=2, the parent and children are excluded from the list.
array$publishedAn optional array of states
array$languagesOptional array of specify which languages we want to filter
int$clientIdOptional client id - viz 0 = site, 1 = administrator, can be NULL for all (used only if menutype not given)
Renvoie
array|boolean
Depuis
1.6

Références $clientId, $db, $languages, $link, $menuType, $menuTypes, $mode, $published, $query, $type, elseif, Factory\getApplication(), Factory\getDbo(), ParameterType\INTEGER, Multilanguage\isEnabled(), null, et ParameterType\STRING.

Référencé par MenuitemField\getGroups(), et MenuItemByTypeField\getGroups().

◆ getMenuTypes()

static getMenuTypes (   $clientId = 0)
static

Get the menu list for create a menu module

Paramètres
int$clientIdOptional client id - viz 0 = site, 1 = administrator, can be NULL for all
Renvoie
array The menu array list
Depuis
1.6

Références $clientId, $db, $query, Factory\getDbo(), et ParameterType\INTEGER.

◆ getPresets()

static getPresets ( )
static

◆ installPreset()

static installPreset (   $preset,
  $menutype 
)
static

Method to install a preset menu into database and link them to the given menutype

Paramètres
string$presetThe preset name
string$menutypeThe target menutype
Renvoie
void
Exceptions

Références $menutype, $root, et Text\_().

◆ loadPreset()

static loadPreset (   $name,
  $fallback = true,
  $parent = null 
)
static

Load the menu items from a preset file into a hierarchical list of objects

Paramètres
string$nameThe preset name
bool$fallbackFallback to default (joomla) preset if the specified one could not be loaded?
AdministratorMenuItem$parentRoot node of the menu
Renvoie
AdministratorMenuItem
Depuis
4.0.0

Références $name, $xml, elseif, null, et path.

Référencé par CssMenu\load().

◆ loadXml()

static loadXml (   $elements,
  $parent,
  $replace = array() 
)
staticprotected

Load a menu tree from an XML file

Paramètres

Following is a repeatable group based on simple database query. This requires sql_* attributes (sql_select and sql_from are required) The values can be used like - "{sql:columnName}" in any attribute of repeated elements. The repeated elements are place inside this xml node but they will be populated in the same level in the rendered menu

Références $db, $item, $query, $result, $results, et Factory\getDbo().

◆ parseXmlNode()

static parseXmlNode (   $node,
  $replace = array() 
)
staticprotected

Create a menu item node from an xml element

Paramètres
\SimpleXMLElement$nodeA menuitem element from preset xml
string[]$replace The values to substitute in the title, link and element texts
Renvoie
Depuis
4.0.0

Références $item, $params, $val, et null.

◆ preprocess()

static preprocess (   $item)
static

Parse the flat list of menu items and prepare the hierarchy of them using parent-child relationship.

Paramètres
AdministratorMenuItem$itemMenu item to preprocess
Renvoie
void
Depuis
4.0.0

Références $item, et null.

◆ resolveAlias()

static resolveAlias ( $item)
static

Method to resolve the menu item alias type menu item

Paramètres
AdministratorMenuItem&$itemThe alias object
Renvoie
void
Depuis
4.0.0

Références $db, $item, $query, Factory\getDbo(), et ParameterType\INTEGER.

Documentation des champs

◆ $_filter

$_filter = array('option', 'view', 'layout')
staticprotected

◆ $presets

$presets = null
staticprotected

La documentation de cette classe a été générée à partir du fichier suivant :