Public Member Functions | |
| __construct (array $menu) | |
| ElggMenuBuilder constructor. | |
| getMenu ($sort_by= 'text') | |
| Get a prepared menu array. | |
| getSelected () | |
| Get the selected menu item. | |
Static Public Member Functions | |
| static | compareByText ($a, $b) |
| Compare two menu items by their display text. | |
| static | compareByName ($a, $b) |
| Compare two menu items by their identifiers. | |
| static | compareByPriority ($a, $b) |
| Compare two menu items by their priority. | |
| static | compareByWeight ($a, $b) |
| Compare two menu items by their priority. | |
Protected Member Functions | |
| selectFromContext () | |
| Select menu items for the current context. | |
| setupSections () | |
| Group the menu items into sections. | |
| setupTrees () | |
| Create trees for each menu section. | |
| findSelected () | |
| Find the menu item that is currently selected. | |
| sort ($sort_by) | |
| Sort the menu sections and trees. | |
Protected Attributes | |
| $menu = array() | |
| $selected = null | |
Definition at line 9 of file ElggMenuBuilder.php.
| ElggMenuBuilder::__construct | ( | array $ | menu | ) |
ElggMenuBuilder constructor.
| ElggMenuItem[] | $menu Array of ElggMenuItem objects |
Definition at line 23 of file ElggMenuBuilder.php.
| static ElggMenuBuilder::compareByName | ( | $ | a, | |
| $ | b | |||
| ) | [static] |
Compare two menu items by their identifiers.
| ElggMenuItem | $a Menu item | |
| ElggMenuItem | $b Menu item |
Definition at line 260 of file ElggMenuBuilder.php.
| static ElggMenuBuilder::compareByPriority | ( | $ | a, | |
| $ | b | |||
| ) | [static] |
Compare two menu items by their priority.
| ElggMenuItem | $a Menu item | |
| ElggMenuItem | $b Menu item |
Definition at line 279 of file ElggMenuBuilder.php.
| static ElggMenuBuilder::compareByText | ( | $ | a, | |
| $ | b | |||
| ) | [static] |
Compare two menu items by their display text.
| ElggMenuItem | $a Menu item | |
| ElggMenuItem | $b Menu item |
Definition at line 242 of file ElggMenuBuilder.php.
| static ElggMenuBuilder::compareByWeight | ( | $ | a, | |
| $ | b | |||
| ) | [static] |
Compare two menu items by their priority.
| ElggMenuItem | $a Menu item | |
| ElggMenuItem | $b Menu item |
Definition at line 297 of file ElggMenuBuilder.php.
| ElggMenuBuilder::findSelected | ( | ) | [protected] |
Find the menu item that is currently selected.
Definition at line 154 of file ElggMenuBuilder.php.
| ElggMenuBuilder::getMenu | ( | $ | sort_by = 'text' |
) |
Get a prepared menu array.
| mixed | $sort_by Method to sort the menu by. |
Definition at line 33 of file ElggMenuBuilder.php.
| ElggMenuBuilder::getSelected | ( | ) |
| ElggMenuBuilder::selectFromContext | ( | ) | [protected] |
Select menu items for the current context.
Definition at line 62 of file ElggMenuBuilder.php.
| ElggMenuBuilder::setupSections | ( | ) | [protected] |
| ElggMenuBuilder::setupTrees | ( | ) | [protected] |
Create trees for each menu section.
Definition at line 105 of file ElggMenuBuilder.php.
| ElggMenuBuilder::sort | ( | $ | sort_by | ) | [protected] |
Sort the menu sections and trees.
| mixed | $sort_by Sort type as string or php callback |
Definition at line 182 of file ElggMenuBuilder.php.
ElggMenuBuilder::$menu = array() [protected] |
Definition at line 14 of file ElggMenuBuilder.php.
ElggMenuBuilder::$selected = null [protected] |
Definition at line 16 of file ElggMenuBuilder.php.
1.6.3