MDL-57072 theme_boost: Render action menu for category management

This commit is contained in:
Jun Pataleta 2016-11-29 10:05:14 +08:00
parent a0352aa95e
commit 8ace7b6c34
2 changed files with 13 additions and 1 deletions

View File

@ -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();

View File

@ -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);