mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-71680 navigation: Enable forcing navigation_node into "more" menu
- Part of: MDL-69588 Adds new property 'forceintomoremenu' and new setter method in the navigation_node class to enable forcing a navigation note into a "more" menu whenever possible.
This commit is contained in:
parent
f28535082c
commit
19fd786270
@ -149,6 +149,8 @@ class navigation_node implements renderable {
|
||||
public $requiresajaxloading = false;
|
||||
/** @var bool If set to true this node will be added to the "flat" navigation */
|
||||
public $showinflatnavigation = false;
|
||||
/** @var bool If set to true this node will be forced into a "more" menu whenever possible */
|
||||
public $forceintomoremenu = false;
|
||||
|
||||
/**
|
||||
* Constructs a new navigation_node
|
||||
@ -840,6 +842,18 @@ class navigation_node implements renderable {
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the node and its children should be added into a "more" menu whenever possible.
|
||||
*
|
||||
* @param bool $forceintomoremenu
|
||||
*/
|
||||
public function set_force_into_more_menu(bool $forceintomoremenu = false) {
|
||||
$this->forceintomoremenu = $forceintomoremenu;
|
||||
foreach ($this->children as $child) {
|
||||
$child->forceintomoremenu = $forceintomoremenu;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the menu item to handle locking and unlocking of a conext.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user