MDL-52160 navigation: Mark category and module settings nodes as branch

This commit is contained in:
Frederic Massart 2015-11-25 13:03:25 +08:00
parent c506af7786
commit 42dcfffc4f

View File

@ -3971,6 +3971,7 @@ class settings_navigation extends navigation_node {
}
$modulenode = $this->add(get_string('pluginadministration', $this->page->activityname), null, self::TYPE_SETTING, null, 'modulesettings');
$modulenode->nodetype = navigation_node::NODETYPE_BRANCH;
$modulenode->force_open();
// Settings for the module
@ -4026,12 +4027,10 @@ class settings_navigation extends navigation_node {
}
$function = $this->page->activityname.'_extend_settings_navigation';
if (!function_exists($function)) {
return $modulenode;
if (function_exists($function)) {
$function($this, $modulenode);
}
$function($this, $modulenode);
// Remove the module node if there are no children.
if ($modulenode->children->count() <= 0) {
$modulenode->remove();
@ -4572,6 +4571,7 @@ class settings_navigation extends navigation_node {
}
$categorynode = $this->add($catcontext->get_context_name(), null, null, null, 'categorysettings');
$categorynode->nodetype = navigation_node::NODETYPE_BRANCH;
$categorynode->force_open();
if (can_edit_in_category($catcontext->instanceid)) {