1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-18 06:58:08 +02:00

MDL-72904 theme_boost: Boost navbar cleanup restrictions

Exclude the last node in a breadcrumb change from auto-removal if no URL provided.
This commit is contained in:
Peter Dias 2021-12-01 11:15:26 +08:00
parent 6d5ab2233a
commit d19547ae69

@ -189,10 +189,12 @@ class boostnavbar implements \renderable {
/**
* Remove items that are categories or have no actions associated with them.
*
* The only exception is the last item in the list which may not have a link but needs to be displayed.
*/
protected function remove_no_link_items(): void {
foreach ($this->items as $key => $value) {
if (!$value->has_action() || $value->type == \navigation_node::TYPE_SECTION) {
if (!$value->is_last() && (!$value->has_action() || $value->type == \navigation_node::TYPE_SECTION)) {
unset($this->items[$key]);
}
}