Elgg Menu Builder.
More...
Elgg Menu Builder.
- Since
- 1.8.0
Definition at line 12 of file ElggMenuBuilder.php.
ElggMenuBuilder::__construct |
( |
|
$items | ) |
|
constructor
- Parameters
-
ElggMenuItem[]|MenuItems | $items Array of objects |
- Exceptions
-
Definition at line 31 of file ElggMenuBuilder.php.
static ElggMenuBuilder::compareByName |
( |
|
$a, |
|
|
|
$b |
|
) |
| |
|
static |
Compare two menu items by their identifiers.
- Parameters
-
- Returns
- int
Definition at line 315 of file ElggMenuBuilder.php.
static ElggMenuBuilder::compareByPriority |
( |
|
$a, |
|
|
|
$b |
|
) |
| |
|
static |
Compare two menu items by their priority.
- Parameters
-
- Returns
- int
- Since
- 1.9.0
Definition at line 336 of file ElggMenuBuilder.php.
static ElggMenuBuilder::compareByText |
( |
|
$a, |
|
|
|
$b |
|
) |
| |
|
static |
Compare two menu items by their display text HTML tags are stripped before comparison.
- Parameters
-
- Returns
- int
Definition at line 295 of file ElggMenuBuilder.php.
ElggMenuBuilder::filterByContext |
( |
| ) |
|
|
protected |
Select menu items for the current context.
- Returns
- MenuItems
Definition at line 89 of file ElggMenuBuilder.php.
ElggMenuBuilder::findSelected |
( |
| ) |
|
|
protected |
Find the menu item that is currently selected.
- Returns
- ElggMenuItem|null
Definition at line 224 of file ElggMenuBuilder.php.
ElggMenuBuilder::getMenu |
( |
|
$sort_by = 'priority' | ) |
|
Get a prepared menu.
- Parameters
-
mixed | $sort_by | Method to sort the menu by. |
- See also
- ::sort()
- Returns
- PreparedMenu
Definition at line 50 of file ElggMenuBuilder.php.
ElggMenuBuilder::getSelected |
( |
| ) |
|
ElggMenuBuilder::getSortCallback |
( |
|
$sort_by = null | ) |
|
|
protected |
Get callback function for sorting.
- Parameters
-
- Returns
- callable|null
Definition at line 271 of file ElggMenuBuilder.php.
ElggMenuBuilder::prepare |
( |
MenuItems |
$items, |
|
|
|
$sort_by = 'priority' |
|
) |
| |
|
protected |
Prepare a menu.
- Parameters
-
MenuItems | $items | Menu items |
string | $sort_by | Sorting parameter |
- Returns
- PreparedMenu
Definition at line 103 of file ElggMenuBuilder.php.
ElggMenuBuilder::setSelected |
( |
string |
$item_name | ) |
|
Set a menu item as selected.
- Parameters
-
string | $item_name | the menu item name to select |
- Returns
- bool
Definition at line 64 of file ElggMenuBuilder.php.
ElggMenuBuilder::setupSections |
( |
MenuItems |
$items | ) |
|
|
protected |
Group the menu items into sections.
- Parameters
-
- Returns
- PreparedMenu
Definition at line 117 of file ElggMenuBuilder.php.
Create trees for each menu section.
- Parameters
-
PreparedMenu | $menu | Prepared menu |
- Returns
- PreparedMenu
Definition at line 150 of file ElggMenuBuilder.php.
Sort the menu sections and trees.
- Parameters
-
PreparedMenu | $menu | Prepared menu |
mixed | $sort_by | Sort type as string or php callback |
- Returns
- PreparedMenu
Definition at line 240 of file ElggMenuBuilder.php.
ElggMenuBuilder::$selected_item = null |
|
protected |
The documentation for this class was generated from the following file: