Class JMenu

Description

JMenu class

  • since: 11.1

Located in /libraries/joomla/application/menu.php (line 19)

JObject
   |
   --JMenu
Direct descendents
Class Description
JMenuAdministrator JMenu class.
JMenuSite JMenu class
Variable Summary
static array $instances
integer $_active
integer $_default
array $_items
Method Summary
static JMenu getInstance (string $client, [array $options = array()])
JMenu __construct ([array $options = array()])
boolean authorise (integer $id)
object The getActive ()
object The getDefault ([string $language = '*'])
mixed getItem (integer $id)
array getItems (string $attributes, string $values, [boolean $firstonly = false])
array getMenu ()
JRegistry getParams (integer $id)
array load ()
mixed setActive (integer $id)
boolean setDefault (integer $id, [string $language = ''])
Variables
static array $instances = array() (line 49)
  • var: JMenu instances container.
  • since: 11.3
  • access: protected
integer $_active = 0 (line 43)

Identifier of the active menu item

  • since: 11.1
  • access: protected
integer $_default = array() (line 35)

Identifier of the default menu item

  • since: 11.1
  • access: protected
array $_items = array() (line 27)

Array to hold the menu items

  • since: 11.1
  • access: protected

Inherited Variables

Inherited from JObject

JObject::$_errors
Methods
static method getInstance (line 87)

Returns a JMenu object

  • return: A menu object.
  • since: 11.1
  • access: public
static JMenu getInstance (string $client, [array $options = array()])
  • string $client: The name of the client
  • array $options: An associative array of options
Constructor __construct (line 58)

Class constructor

  • since: 11.1
  • access: public
JMenu __construct ([array $options = array()])
  • array $options: An array of configuration options.

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.
authorise (line 324)

Method to check JMenu object authorization against an access control object and optionally an access extension object

  • return: True if authorised
  • since: 11.1
  • access: public
boolean authorise (integer $id)
  • integer $id: The menu id
getActive (line 211)

Get menu item by id.

  • return: item object.
  • since: 11.1
  • access: public
object The getActive ()
getDefault (line 167)

Get the default item by language code.

  • return: item object
  • since: 11.1
  • access: public
object The getDefault ([string $language = '*'])
  • string $language: The language code, default value of * means all.

Redefined in descendants as:
getItem (line 126)

Get menu item by id

  • return: The item object, or null if not found
  • since: 11.1
  • access: public
mixed getItem (integer $id)
  • integer $id: The item id
getItems (line 233)

Gets menu items by attribute

  • since: 11.1
  • access: public
array getItems (string $attributes, string $values, [boolean $firstonly = false])
  • string $attributes: The field name
  • string $values: The value of the field
  • boolean $firstonly: If true, only returns the first item found

Redefined in descendants as:
getMenu (line 309)

Getter for the menu array

  • since: 11.1
  • access: public
array getMenu ()
getParams (line 290)

Gets the parameter object for a certain menu item

  • return: A JRegistry object
  • since: 11.1
  • access: public
JRegistry getParams (integer $id)
  • integer $id: The item id
load (line 346)

Loads the menu items

  • since: 11.1
  • access: public
array load ()

Redefined in descendants as:
setActive (line 192)

Set the default item by id

  • return: If successful the active item, otherwise null
  • since: 11.1
  • access: public
mixed setActive (integer $id)
  • integer $id: The item id
setDefault (line 147)

Set the default item by id and language code.

  • return: True, if successful
  • since: 11.1
  • access: public
boolean setDefault (integer $id, [string $language = ''])
  • integer $id: The menu item id.
  • string $language: The language cod (since 1.6).

Inherited Methods

Inherited From JObject

JObject::__construct()
JObject::def()
JObject::get()
JObject::getError()
JObject::getErrors()
JObject::getProperties()
JObject::set()
JObject::setError()
JObject::setProperties()
JObject::toString()
JObject::__toString()

Documentation generated on Mon, 25 Jun 2012 13:57:06 -0500 by phpDocumentor 1.4.4