mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-56919 boost: Render non-action menu items as disabled action links
This commit is contained in:
parent
27a3843d05
commit
894b1825f6
@ -712,22 +712,25 @@ class core_renderer extends \core_renderer {
|
||||
continue;
|
||||
}
|
||||
if ($menuitem->action) {
|
||||
$text = $menuitem->text;
|
||||
if ($menuitem->action instanceof action_link) {
|
||||
$link = $menuitem->action;
|
||||
} else {
|
||||
$link = new action_link($menuitem->action, $menuitem->text, null, null, $menuitem->icon);
|
||||
}
|
||||
if ($indent) {
|
||||
$link->add_class('m-l-1');
|
||||
}
|
||||
} else {
|
||||
if ($onlytopleafnodes) {
|
||||
$skipped = true;
|
||||
continue;
|
||||
}
|
||||
$link = $menuitem->text;
|
||||
$link = new action_link(new moodle_url('#'), $menuitem->text, null, ['disabled' => true], $menuitem->icon);
|
||||
}
|
||||
if ($indent) {
|
||||
$link->add_class('m-l-1');
|
||||
}
|
||||
if (!empty($menuitem->classes)) {
|
||||
$link->add_class(implode(" ", $menuitem->classes));
|
||||
}
|
||||
|
||||
$menu->add_secondary_action($link);
|
||||
$skipped = $skipped || $this->build_action_menu_from_navigation($menu, $menuitem, true);
|
||||
}
|
||||
|
@ -10,7 +10,8 @@
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
a:first-of-type > .icon {
|
||||
a:first-of-type > .icon,
|
||||
span:first-of-type > .icon {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user