Class JMenu
Methods summary
public
|
#
__construct( array $options = array() )
Class constructor
Parameters
- $options
array - $options An array of configuration options.
Since
1.5
|
public static
JMenu
|
#
getInstance( string $client, array $options = array() )
Returns a JMenu object
Parameters
- $client
string - $client The name of the client
- $options
array - $options An associative array of options
Returns
Throws
Since
1.5
|
public
JMenuItem |null
|
#
getItem( integer $id )
Get menu item by id
Parameters
- $id
integer - $id The item id
Returns
JMenuItem |null
- The item object if the ID exists or null if not found
Since
1.5
|
public
boolean
|
#
setDefault( integer $id, string $language = '*' )
Set the default item by id and language code.
Set the default item by id and language code.
Parameters
- $id
integer - $id The menu item id.
- $language
string - $language The language code (since 1.6).
Returns
boolean - True if a menu item with the given ID exists
Since
1.5
|
public
JMenuItem |null
|
#
getDefault( string $language = '*' )
Get the default item by language code.
Get the default item by language code.
Parameters
- $language
string - $language The language code, default value of * means all.
Returns
JMenuItem |null
- The item object or null when not found for given language
Since
1.5
|
public
JMenuItem |null
|
#
setActive( integer $id )
Set the default item by id
Set the default item by id
Parameters
- $id
integer - $id The item id
Returns
JMenuItem |null
- The menu item representing the given ID if present or null otherwise
Since
1.5
|
public
JMenuItem |null
|
#
getActive( )
Get menu item by id.
Returns
JMenuItem |null
- The item object if an active menu item has been set or null
Since
1.5
|
public
JMenuItem |JMenuItem[]
|
#
getItems( mixed $attributes, mixed $values, boolean $firstonly = false )
Gets menu items by attribute
Gets menu items by attribute
Parameters
- $attributes
mixed - $attributes The field name(s).
- $values
mixed - $values 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 - $firstonly If true, only returns the first item found
Returns
JMenuItem |JMenuItem[]
- An array of menu item objects or a single object if the $firstonly parameter is
true
Since
1.5
|
public
Joomla\Registry\Registry
|
#
getParams( integer $id )
Gets the parameter object for a certain menu item
Gets the parameter object for a certain menu item
Parameters
- $id
integer - $id The item id
Returns
Since
1.5
|
public
boolean
|
#
authorise( integer $id )
Method to check JMenu object authorization against an access control object
and optionally an access extension object
Method to check JMenu object authorization against an access control object
and optionally an access extension object
Parameters
- $id
integer - $id The menu id
Returns
boolean
Since
1.5
|
public
array
|
#
load( )
Loads the menu items
Returns
array
Since
1.5
|
Magic methods summary
Properties summary
protected
JMenuItem[]
|
$_items
|
#
Array to hold the menu items
Array to hold the menu items
Deprecated
4.0 Will convert to $items
Since
1.5
|
protected
integer
|
$_default
|
#
Identifier of the default menu item
Identifier of the default menu item
Deprecated
4.0 Will convert to $default
Since
1.5
|
protected
integer
|
$_active
|
#
Identifier of the active menu item
Identifier of the active menu item
Deprecated
4.0 Will convert to $active
Since
1.5
|
protected static
JMenu[]
|
$instances
|
#
JMenu instances container.
JMenu instances container.
Since
1.7
|
protected
JUser
|
$user
|
#
User object to check access levels for
User object to check access levels for
Since
3.5
|