Joomla! 1.5 API

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2011 Open Source Matters Inc and can be used in accordance with the Joomla! Electronic Documentation License. Some parts of this website may be subject to other licenses.

 Class JMenu

Description

JMenu class

  • since: 1.5

Located in /joomla/application/menu.php (line 25)

Class JObject   (Subpackage Base)

Class JMenu   (Subpackage Application)
Method Summary
Constructor boolean __construct ([ $options = array()])
Method boolean authorize (integer $id, [integer $accessid = 0])
Method object The &getActive ()
Method object The &getDefault ()
Method JMenu &getInstance (string $client, [array $options = array()])
Method mixed &getItem (int $id)
Method array getItems (string $attribute, string $value, [boolean $firstonly = false])
Method array getMenu ()
Method object A &getParams (int $id)
Abstract method array load ()
Method If &setActive (int $id)
Method True, setDefault (int $id)
Variables

Inherited Variables

Inherited from JObject

Variable JObject::$_errors
Methods
Constructor __construct (line 58)

Class constructor

  • return: True on success
  • access: public
boolean __construct ([ $options = array()])
  • $options

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

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

  • return: True if authorized
  • access: public
boolean authorize (integer $id, integer $accessid)
  • integer $id: The menu id
  • integer $accessid: The users access identifier
getActive (line 191)

Get menu item by id

  • return: item object
  • access: public
object The &getActive ()
getDefault (line 158)

Get menu item by id

  • return: item object
  • access: public
object The &getDefault ()
getInstance (line 82)

Returns a reference to a JMenu object

This method must be invoked as:

  $menu = &JSite::getMenu();

  • return: A menu object.
  • since: 1.5
  • access: public
JMenu &getInstance (string $client, [array $options = array()])
  • string $client: The name of the client
  • array $options: An associative array of options
getItem (line 124)

Get menu item by id

  • return: The item object, or null if not found
  • access: public
mixed &getItem (int $id)
  • int $id: The item id
getItems (line 211)

Gets menu items by attribute

  • access: public
array getItems (string $attribute, string $value, [boolean $firstonly = false])
  • string $attribute: The field name
  • string $value: The value of the field
  • boolean $firstonly: If true, only returns the first item found
getMenu (line 257)

Getter for the menu array

  • access: public
array getMenu ()
getParams (line 240)

Gets the parameter object for a certain menu item

  • return: JParameter object
  • access: public
object A &getParams (int $id)
  • int $id: The item id
load (line 283)

Loads the menu items

  • abstract:
  • access: public
array load ()
setActive (line 171)

Set the default item by id

  • return: successfull the active item, otherwise null
  • access: public
If &setActive (int $id)
  • int $id: The item id
setDefault (line 141)

Set the default item by id

  • return: if succesfull
  • access: public
True, setDefault (int $id)
  • int $id: The item id

Inherited Methods

Inherited From JObject

 JObject::JObject()
 JObject::__construct()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::getPublicProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::toString()
Support Joomla!