mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-57072 theme_boost: Render action menu for category management
This commit is contained in:
parent
a0352aa95e
commit
8ace7b6c34
@ -4958,7 +4958,8 @@ class settings_navigation extends navigation_node {
|
||||
throw new coding_exception('Unexpected context while loading category settings.');
|
||||
}
|
||||
|
||||
$categorynode = $this->add($catcontext->get_context_name(), null, null, null, 'categorysettings');
|
||||
$categorynodetype = navigation_node::TYPE_CONTAINER;
|
||||
$categorynode = $this->add($catcontext->get_context_name(), null, $categorynodetype, null, 'categorysettings');
|
||||
$categorynode->nodetype = navigation_node::NODETYPE_BRANCH;
|
||||
$categorynode->force_open();
|
||||
|
||||
|
@ -680,6 +680,17 @@ class core_renderer extends \core_renderer {
|
||||
$this->build_action_menu_from_navigation($menu, $node);
|
||||
}
|
||||
}
|
||||
|
||||
} else if ($context->contextlevel == CONTEXT_COURSECAT) {
|
||||
// For course category context, show category settings menu, if we're on the course category page.
|
||||
if ($this->page->pagetype === 'course-index-category') {
|
||||
$node = $this->page->settingsnav->find('categorysettings', navigation_node::TYPE_CONTAINER);
|
||||
if ($node) {
|
||||
// Build an action menu based on the visible nodes from this navigation tree.
|
||||
$this->build_action_menu_from_navigation($menu, $node);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$items = $this->page->navbar->get_items();
|
||||
$navbarnode = end($items);
|
||||
|
Loading…
x
Reference in New Issue
Block a user