Commit 894b1825 authored by jun's avatar jun
Browse files

MDL-56919 boost: Render non-action menu items as disabled action links

parent 27a3843d
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment