Skip to content

Commit

Permalink
MDL-52160 navigation: Mark category and module settings nodes as branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Nov 25, 2015
1 parent c506af7 commit 42dcfff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/navigationlib.php
Expand Up @@ -3971,6 +3971,7 @@ protected function load_module_settings() {
}

$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
Expand Down Expand Up @@ -4026,12 +4027,10 @@ protected function load_module_settings() {
}

$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();
Expand Down Expand Up @@ -4572,6 +4571,7 @@ protected function load_category_settings() {
}

$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)) {
Expand Down

0 comments on commit 42dcfff

Please sign in to comment.