Public Member Functions | |
| __construct ($name, $text, $href) | |
| ElggMenuItem constructor. | |
| setData ($key, $value=null) | |
| Set a data key/value pair or a set of key/value pairs. | |
| getData ($key) | |
| Get stored data. | |
| setName ($name) | |
| Set the identifier of the menu item. | |
| getName () | |
| Get the identifier of the menu item. | |
| setText ($text) | |
| Set the display text of the menu item. | |
| getText () | |
| Get the display text of the menu item. | |
| setHref ($href) | |
| Set the URL of the menu item. | |
| getHref () | |
| Get the URL of the menu item. | |
| setContext ($contexts) | |
| Set the contexts that this menu item is available for. | |
| getContext () | |
| Get an array of context strings. | |
| inContext ($context= '') | |
| Should this menu item be used given the current context. | |
| setSelected ($state=true) | |
| Set the selected flag. | |
| getSelected () | |
| Get selected state. | |
| setTooltip ($text) | |
| Set the tool tip text. | |
| getTooltip () | |
| Get the tool tip text. | |
| setConfirmText ($text) | |
| Set the confirm text shown when link is clicked. | |
| getConfirmText () | |
| Get the confirm text. | |
| setLinkClass ($class) | |
| Set the anchor class. | |
| getLinkClass () | |
| Get the anchor classes as text. | |
| addLinkClass ($class) | |
| Add a link class. | |
| setItemClass ($class) | |
| Set the li classes. | |
| getItemClass () | |
| Get the li classes as text. | |
| setWeight ($priority) | |
| Set the priority of the menu item. | |
| getWeight () | |
| Get the priority of the menu item. | |
| setPriority ($priority) | |
| Set the priority of the menu item. | |
| getPriority () | |
| Get the priority of the menu item. | |
| setSection ($section) | |
| Set the section identifier. | |
| getSection () | |
| Get the section identifier. | |
| setParentName ($name) | |
| Set the parent identifier. | |
| getParentName () | |
| Get the parent identifier. | |
| setParent ($parent) | |
| Set the parent menu item. | |
| getParent () | |
| Get the parent menu item. | |
| addChild ($item) | |
| Add a child menu item. | |
| setChildren ($children) | |
| Set the menu item's children. | |
| getChildren () | |
| Get the children menu items. | |
| sortChildren ($sortFunction) | |
| Sort the children. | |
| getContent (array $vars=array()) | |
| Get the menu item content (usually a link). | |
Static Public Member Functions | |
| static | factory ($options) |
| ElggMenuItem factory method. | |
Protected Attributes | |
| $data | |
| $text | |
| $href = null | |
| $title = false | |
| $confirm = '' | |
Definition at line 11 of file ElggMenuItem.php.
| ElggMenuItem::__construct | ( | $ | name, | |
| $ | text, | |||
| $ | href | |||
| ) |
ElggMenuItem constructor.
| string | $name Identifier of the menu item | |
| string | $text Display text of the menu item | |
| string | $href URL of the menu item (false if not a link) |
Definition at line 76 of file ElggMenuItem.php.
| ElggMenuItem::addChild | ( | $ | item | ) |
Add a child menu item.
| ElggMenuItem | $item A child menu item |
Definition at line 515 of file ElggMenuItem.php.
| ElggMenuItem::addLinkClass | ( | $ | class | ) |
Add a link class.
| mixed | $class An array of class names, or a single string class name. |
Definition at line 370 of file ElggMenuItem.php.
| static ElggMenuItem::factory | ( | $ | options | ) | [static] |
ElggMenuItem factory method.
This static method creates an ElggMenuItem from an associative array. Required keys are name, text, and href.
| array | $options Option array of key value pairs |
Definition at line 98 of file ElggMenuItem.php.
| ElggMenuItem::getChildren | ( | ) |
| ElggMenuItem::getConfirmText | ( | ) |
| ElggMenuItem::getContent | ( | array $ | vars = array() |
) |
Get the menu item content (usually a link).
| array | $vars Options to pass to output/url if a link |
Definition at line 558 of file ElggMenuItem.php.
| ElggMenuItem::getContext | ( | ) |
| ElggMenuItem::getData | ( | $ | key | ) |
Get stored data.
| string | $key The key for the requested key/value pair |
Definition at line 173 of file ElggMenuItem.php.
| ElggMenuItem::getHref | ( | ) |
| ElggMenuItem::getItemClass | ( | ) |
| ElggMenuItem::getLinkClass | ( | ) |
| ElggMenuItem::getName | ( | ) |
Get the identifier of the menu item.
Definition at line 196 of file ElggMenuItem.php.
| ElggMenuItem::getParent | ( | ) |
Get the parent menu item.
Definition at line 505 of file ElggMenuItem.php.
| ElggMenuItem::getParentName | ( | ) |
| ElggMenuItem::getPriority | ( | ) |
| ElggMenuItem::getSection | ( | ) |
| ElggMenuItem::getSelected | ( | ) |
| ElggMenuItem::getText | ( | ) |
Get the display text of the menu item.
Definition at line 215 of file ElggMenuItem.php.
| ElggMenuItem::getTooltip | ( | ) |
| ElggMenuItem::getWeight | ( | ) |
| ElggMenuItem::inContext | ( | $ | context = '' |
) |
Should this menu item be used given the current context.
| string | $context A context string (default is empty string for current context stack). |
Definition at line 267 of file ElggMenuItem.php.
| ElggMenuItem::setChildren | ( | $ | children | ) |
Set the menu item's children.
| array | $children Array of ElggMenuItems |
Definition at line 525 of file ElggMenuItem.php.
| ElggMenuItem::setConfirmText | ( | $ | text | ) |
Set the confirm text shown when link is clicked.
| string | $text The text to show |
Definition at line 328 of file ElggMenuItem.php.
| ElggMenuItem::setContext | ( | $ | contexts | ) |
Set the contexts that this menu item is available for.
| array | $contexts An array of context strings |
Definition at line 244 of file ElggMenuItem.php.
| ElggMenuItem::setData | ( | $ | key, | |
| $ | value = null | |||
| ) |
Set a data key/value pair or a set of key/value pairs.
This method allows storage of arbitrary data with this menu item. The data can be used for sorting, custom rendering, or any other use.
| mixed | $key String key or an associative array of key/value pairs | |
| mixed | $value The value if $key is a string |
Definition at line 159 of file ElggMenuItem.php.
| ElggMenuItem::setHref | ( | $ | href | ) |
Set the URL of the menu item.
| string | $href URL or false if not a link |
Definition at line 225 of file ElggMenuItem.php.
| ElggMenuItem::setItemClass | ( | $ | class | ) |
Set the li classes.
| mixed | $class An array of class names, or a single string class name. |
Definition at line 384 of file ElggMenuItem.php.
| ElggMenuItem::setLinkClass | ( | $ | class | ) |
Set the anchor class.
| mixed | $class An array of class names, or a single string class name. |
Definition at line 347 of file ElggMenuItem.php.
| ElggMenuItem::setName | ( | $ | name | ) |
Set the identifier of the menu item.
| string | $name Unique identifier |
Definition at line 187 of file ElggMenuItem.php.
| ElggMenuItem::setParent | ( | $ | parent | ) |
Set the parent menu item.
| ElggMenuItem | $parent The parent of this menu item |
Definition at line 496 of file ElggMenuItem.php.
| ElggMenuItem::setParentName | ( | $ | name | ) |
Set the parent identifier.
| string | $name The identifier of the parent ElggMenuItem |
Definition at line 477 of file ElggMenuItem.php.
| ElggMenuItem::setPriority | ( | $ | priority | ) |
Set the priority of the menu item.
| int | $priority The smaller numbers mean higher priority (1 before 100) |
Definition at line 439 of file ElggMenuItem.php.
| ElggMenuItem::setSection | ( | $ | section | ) |
Set the section identifier.
| string | $section The identifier of the section |
Definition at line 458 of file ElggMenuItem.php.
| ElggMenuItem::setSelected | ( | $ | state = true |
) |
Set the selected flag.
| bool | $state Selected state (default is true) |
Definition at line 290 of file ElggMenuItem.php.
| ElggMenuItem::setText | ( | $ | text | ) |
Set the display text of the menu item.
| string | $text The display text |
Definition at line 206 of file ElggMenuItem.php.
| ElggMenuItem::setTooltip | ( | $ | text | ) |
Set the tool tip text.
| string | $text The text of the tool tip |
Definition at line 309 of file ElggMenuItem.php.
| ElggMenuItem::setWeight | ( | $ | priority | ) |
Set the priority of the menu item.
| int | $priority The smaller numbers mean higher priority (1 before 100) |
Definition at line 419 of file ElggMenuItem.php.
| ElggMenuItem::sortChildren | ( | $ | sortFunction | ) |
Sort the children.
| string | $sortFunction A function that is passed to usort() |
Definition at line 544 of file ElggMenuItem.php.
ElggMenuItem::$confirm = '' [protected] |
Definition at line 66 of file ElggMenuItem.php.
ElggMenuItem::$data [protected] |
Definition at line 16 of file ElggMenuItem.php.
ElggMenuItem::$href = null [protected] |
Definition at line 56 of file ElggMenuItem.php.
ElggMenuItem::$text [protected] |
Definition at line 51 of file ElggMenuItem.php.
ElggMenuItem::$title = false [protected] |
Definition at line 61 of file ElggMenuItem.php.
1.6.3