|
| flag_active_nodes (object $node, bool $expandedmenu=false) |
| Recursive checks if any of the children is active.
|
|
| get_custom_menu (renderer_base $output) |
| Custom menu items reside on the same level as the original nodes.
|
|
| get_primary_nav ($parent=null) |
| Get the primary nav object and standardize the output.
|
|
| merge_primary_and_custom (array $primary, array $custom, bool $expandedmenu=false) |
| When defining custom menu items, the active flag is not obvserved correctly.
|
|
- Copyright
- 2021 onwards Peter Dias
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core\navigation\output\primary::__construct |
( |
| $page | ) |
|
primary constructor.
- Parameters
-
◆ export_for_template()
core\navigation\output\primary::export_for_template |
( |
?renderer_base | $output = null | ) |
|
Combine the various menus into a standardized output.
- Parameters
-
renderer_base | null | $output | |
- Return values
-
◆ flag_active_nodes()
core\navigation\output\primary::flag_active_nodes |
( |
object | $node, |
|
|
bool | $expandedmenu = false ) |
|
protected |
Recursive checks if any of the children is active.
If that's the case this node (the parent) is active as well. If the node has no children, check if the node itself is active. Use pass by reference for the node object because we actively change/set the "isactive" flag inside the method and this needs to be kept at the callers side. Set $expandedmenu to true, if the mobile menu is done, in this case the active flag gets the node that is actually active, while the parent hierarchy of the active node gets the flag isopen.
- Parameters
-
object | $node | |
bool | $expandedmenu | |
- Return values
-
◆ get_custom_menu()
core\navigation\output\primary::get_custom_menu |
( |
renderer_base | $output | ) |
|
|
protected |
Custom menu items reside on the same level as the original nodes.
Fetch and convert the nodes to a standardised array.
- Parameters
-
- Return values
-
◆ get_primary_nav()
core\navigation\output\primary::get_primary_nav |
( |
| $parent = null | ) |
|
|
protected |
Get the primary nav object and standardize the output.
- Parameters
-
navigation_node | null | $parent | used for nested nodes, by default the primarynav node |
- Return values
-
◆ get_user_menu()
core\navigation\output\primary::get_user_menu |
( |
renderer_base | $output | ) |
|
Get/Generate the user menu.
This is leveraging the data from user_get_user_navigation_info and the logic in $OUTPUT->user_menu()
- Parameters
-
- Return values
-
◆ merge_primary_and_custom()
core\navigation\output\primary::merge_primary_and_custom |
( |
array | $primary, |
|
|
array | $custom, |
|
|
bool | $expandedmenu = false ) |
|
protected |
When defining custom menu items, the active flag is not obvserved correctly.
Therefore, the merge of the primary and custom navigation must be handled a bit smarter. Change the "isactive" flag of the nodes (this may set by default in the primary nav nodes but is entirely missing in the custom nav nodes). Set the $expandedmenu argument to true when the menu for the mobile template is build.
- Parameters
-
array | $primary | |
array | $custom | |
bool | $expandedmenu | |
- Return values
-
The documentation for this class was generated from the following file:
- lib/classes/navigation/output/primary.php