AdministratorMenu
Extends \Joomla\CMS\Menu\AbstractMenuMenu class.
since |
1.5 |
---|
Methods
__construct
Class constructor
__construct(array $options = array())
since |
1.5 |
---|
Arguments
- $options
array
An array of configuration options.
authorise
Method to check Menu object authorization against an access control object and optionally an access extension object
authorise(integer $id) : boolean
since |
1.5 |
---|
Arguments
- $id
integer
The menu id
Response
boolean
getActive
Get menu item by id.
getActive() : \Joomla\CMS\Menu\MenuItem|null
since |
1.5 |
---|
Response
\Joomla\CMS\Menu\MenuItem|null
The item object if an active menu item has been set or null
getDefault
Get the default item by language code.
getDefault(string $language = '*') : \Joomla\CMS\Menu\MenuItem|null
since |
1.5 |
---|
Arguments
- $language
string
The language code, default value of * means all.
Response
\Joomla\CMS\Menu\MenuItem|null
The item object or null when not found for given language
getInstance
Returns a Menu object
getInstance(string $client, array $options = array()) : \Joomla\CMS\Menu\AbstractMenu
since |
1.5 |
---|---|
throws |
|
Arguments
- $client
string
The name of the client- $options
array
An associative array of options
Response
\Joomla\CMS\Menu\AbstractMenu
A menu object.
getItem
Get menu item by id
getItem(integer $id) : \Joomla\CMS\Menu\MenuItem|null
since |
1.5 |
---|
Arguments
- $id
integer
The item id
Response
\Joomla\CMS\Menu\MenuItem|null
The item object if the ID exists or null if not found
getItems
Gets menu items by attribute
getItems(mixed $attributes, mixed $values, boolean $firstonly = false) : \Joomla\CMS\Menu\MenuItem|array<mixed,\Joomla\CMS\Menu\MenuItem>
since |
1.5 |
---|
Arguments
- $attributes
mixed
The field name(s).- $values
mixed
The value(s) of the field. If an array, need to match field names each attribute may have multiple values to lookup for.- $firstonly
boolean
If true, only returns the first item found
Response
\Joomla\CMS\Menu\MenuItem|array<mixed,\Joomla\CMS\Menu\MenuItem>
An array of menu item objects or a single object if the $firstonly parameter is true
getMenu
Getter for the menu array
getMenu() : array<mixed,\Joomla\CMS\Menu\MenuItem>
getParams
Gets the parameter object for a certain menu item
getParams(integer $id) : \Joomla\Registry\Registry
load
Loads the menu items
load() : array
since |
1.5 |
---|
Response
array
setActive
Set the default item by id
setActive(integer $id) : \Joomla\CMS\Menu\MenuItem|null
since |
1.5 |
---|
Arguments
- $id
integer
The item id
Response
\Joomla\CMS\Menu\MenuItem|null
The menu item representing the given ID if present or null otherwise
setDefault
Set the default item by id and language code.
setDefault(integer $id, string $language = '*') : boolean
since |
1.5 |
---|
Arguments
- $id
integer
The menu item id.- $language
string
The language code (since 1.6).
Response
boolean
True if a menu item with the given ID exists
Properties
_items
Array to hold the menu items
_default
Identifier of the default menu item
since |
1.5 |
---|---|
deprecated |
4.0 Will convert to $default |
Type(s)
integer
_active
Identifier of the active menu item
since |
1.5 |
---|---|
deprecated |
4.0 Will convert to $active |
Type(s)
integer
instances
Menu instances container.
user
User object to check access levels for
since |
3.5 |
---|
Type(s)
\JUser