|
| __construct ( $text, protected moodle_url ?moodle_url $url=null, $title=null, $sort=null, protected custom_menu_item ?custom_menu_item $parent=null, protected array array $attributes=[],) |
| Constructs the new custom menu item.
|
|
| add ( $text, ?moodle_url $url=null, $title=null, $sort=null, $attributes=[],) |
| Adds a custom menu item as a child of this node given its properties.
|
|
| export_for_template (renderer_base $output) |
| Export this data so it can be used as the context for a mustache template.
|
|
| get_children () |
| Sorts and returns the children for this item.
|
|
| get_parent () |
| Gets the parent this child belong to.
|
|
| get_sort_order () |
| Gets the sort order for this child.
|
|
| get_text () |
| Returns the text for this item.
|
|
| get_title () |
| Returns the title for this item.
|
|
| get_url () |
| Returns the url for this item.
|
|
| has_children () |
| Returns true if this item has any children.
|
|
| remove_child (custom_menu_item $menuitem) |
| Removes a custom menu item that is a child or descendant to the current menu.
|
|
| set_text ($text) |
| Sets the text for the node.
|
|
| set_title ($title) |
| Sets the title for the node.
|
|
| set_url (moodle_url $url) |
| Sets the url for the node.
|
|
| sort () |
| Sorts the children this item has.
|
|
|
array | $children = [] |
| A array in which to store children this item has.
|
|
int | $lastsort = 0 |
| A reference to the sort var of the last child that was added.
|
|
int | $sort |
| A sort order for the item, not necessary if you order things in the CFG var.
|
|
string | $text |
| The text to show for the item.
|
|
string | $title |
| A title to apply to the item.
|
|
◆ __construct()
core\output\custom_menu_item::__construct |
( |
| $text, |
|
|
protected moodle_url ?moodle_url | $url = null, |
|
|
| $title = null, |
|
|
| $sort = null, |
|
|
protected custom_menu_item ?custom_menu_item | $parent = null, |
|
|
protected array array | $attributes = [] ) |
Constructs the new custom menu item.
- Parameters
-
string | $text | |
null | moodle_url | $url | A moodle url to apply as the link for this item [Optional] |
string | $title | A title to apply to this item [Optional] |
int | $sort | A sort or to use if we need to sort differently [Optional] |
null | custom_menu_item | $parent | A reference to the parent custom_menu_item this child belongs to, only if the child has a parent. [Optional] |
array | $attributes | Array of other HTML attributes for the custom menu item. |
- Parameters
-
$url | The link to give the icon if it has no children |
$parent | A reference to the parent for this item or NULL if it is a top level item |
$attributes | Array of other HTML attributes for the custom menu item. |
◆ add()
core\output\custom_menu_item::add |
( |
| $text, |
|
|
?moodle_url | $url = null, |
|
|
| $title = null, |
|
|
| $sort = null, |
|
|
| $attributes = [] ) |
Adds a custom menu item as a child of this node given its properties.
- Parameters
-
string | $text | |
null | moodle_url | $url | |
string | $title | |
int | $sort | |
array | $attributes | Array of other HTML attributes for the custom menu item. |
- Return values
-
◆ export_for_template()
core\output\custom_menu_item::export_for_template |
( |
renderer_base | $output | ) |
|
Export this data so it can be used as the context for a mustache template.
- Parameters
-
renderer_base | $output | Used to do a final render of any components that need to be rendered for export. |
- Return values
-
Implements core\output\templatable.
◆ get_children()
core\output\custom_menu_item::get_children |
( |
| ) |
|
Sorts and returns the children for this item.
- Return values
-
◆ get_parent()
core\output\custom_menu_item::get_parent |
( |
| ) |
|
Gets the parent this child belong to.
- Return values
-
◆ get_sort_order()
core\output\custom_menu_item::get_sort_order |
( |
| ) |
|
Gets the sort order for this child.
- Return values
-
◆ get_text()
core\output\custom_menu_item::get_text |
( |
| ) |
|
Returns the text for this item.
- Return values
-
◆ get_title()
core\output\custom_menu_item::get_title |
( |
| ) |
|
Returns the title for this item.
- Return values
-
◆ get_url()
core\output\custom_menu_item::get_url |
( |
| ) |
|
Returns the url for this item.
- Return values
-
◆ has_children()
core\output\custom_menu_item::has_children |
( |
| ) |
|
Returns true if this item has any children.
- Return values
-
◆ remove_child()
Removes a custom menu item that is a child or descendant to the current menu.
Returns true if child was found and removed.
- Parameters
-
custom_menu_item | $menuitem | |
- Return values
-
◆ set_text()
core\output\custom_menu_item::set_text |
( |
| $text | ) |
|
Sets the text for the node.
- Parameters
-
◆ set_title()
core\output\custom_menu_item::set_title |
( |
| $title | ) |
|
Sets the title for the node.
- Parameters
-
◆ set_url()
core\output\custom_menu_item::set_url |
( |
moodle_url | $url | ) |
|
Sets the url for the node.
- Parameters
-
◆ $title
string core\output\custom_menu_item::$title |
|
protected |
A title to apply to the item.
By default the text
The documentation for this class was generated from the following file:
- lib/classes/output/custom_menu_item.php