Class: Menu
Source Location: /blogs/inc/_core/ui/_menu.class.php
Class Menu
Class Overview
|
Menu class Located in /blogs/inc/_core/ui/_menu.class.php [line 40] Widget | --Menu |
[ Top ]
Direct descendents
| Child Class | Description |
|---|---|
| AdminUI_general | The general Admin UI class. It provides functions to handle the UI part of the Backoffice. |
[ Top ]
Inherited Properties, Constants, and Methods
| Inherited Properties | Inherited Methods | Inherited Constants |
|---|---|---|
|
Inherited From Widget |
Inherited From Widget
|
[ Top ]
Method Summary
| void | add_menu_entries() | Add menu entries to the list of entries for a given path. |
| string | get_html_menu() | Get the HTML for the menu entries of a specific path. |
| array | get_menu_entries() | Get menu entries for a given path. |
| array|false | &get_node_by_path() | Get the reference of a node from the menu entries using a path. |
| string|false | get_selected() | Get the key of a selected entry for a path. |
| array | get_template() | Get a template by name. |
| boolean | insert_menu_entries_after() | Insert new menu entries right after the menu entry passed as path |
[ Top ]
Properties
array
$_menus
= array() [line 50]
The menu structure (array of arrays)
Use add_menu_entries() to add them here.
API Tags:| Access: | protected |
[ Top ]
Methods
add_menu_entries [line 66]
|
Add menu entries to the list of entries for a given path.
Parameters:| NULL|string|array | $path: | The path to add the entries to. See get_node_by_path(). |
| array | $new_entries: | Menu entries to add (key (string) => entry (array)). An entry can have the following keys: 'text': Text/Caption for this entry. 'href': The link for this entry. 'entries': array of sub-entries DEPRECATED 'style': CSS style for this entry. DEPRECATED 'onclick': onclick property for this entry. DEPRECATED 'name': name attribute of the link/entry. |
API Tags:
| Usedby: | AdminUI_general::unshift_menu_entries() |
[ Top ]
get_html_menu [line 217]
|
Get the HTML for the menu entries of a specific path.
Parameters:| NULL|string|array | $path: | The path. See get_node_by_path(). |
| string | $template: | Template name, see get_template(). |
| $level: |
API Tags:
| Return: | The HTML for the menu. |
[ Top ]
get_menu_entries [line 183]
|
Get menu entries for a given path.
Parameters:| NULL|string|array | $path: | The path. See get_node_by_path(). |
API Tags:
| Return: | The menu entries (may be empty). |
[ Top ]
get_node_by_path [line 144]
|
Get the reference of a node from the menu entries using a path.
Parameters:| array|string|NULL | $path: |
The path. NULL means root, string means child of root, array means path below root. (eg
|
| boolean | $createIfNotExisting: | Should the node be created if it does not exist already? |
API Tags:
| Return: | The node as array or false, if the path does not exist (and we do not $createIfNotExisting). |
[ Top ]
get_selected [line 197]
|
Get the key of a selected entry for a path.
Parameters:| NULL|string|array | $path: | The path. See get_node_by_path(). |
[ Top ]
get_template [line 375]
|
Get a template by name.
This is a method (and not a member array) to allow dynamic generation and T_()
Parameters:| string | $name: | Name of the template ('main', 'sub') |
| $level: |
API Tags:
| Return: | Associative array which defines layout and optionally properties. |
Redefined in descendants as:
- AdminUI_general::get_template() : Get a template by name.
- AdminUI::get_template() : Get a template by name and depth.
[ Top ]
insert_menu_entries_after [line 92]
|
Insert new menu entries right after the menu entry passed as path
Parameters:| NULL|string|array | $path: | The path. See get_node_by_path(). |
| new | $new_entries: | entries |
| position | $index: | after which to insert new entries. If not given, new entries is inserted after Path |
API Tags:
| Return: | Whether inserting was successfull. |
[ Top ]
