Skip to content

Commit

Permalink
Merge branch 'master_MDL-56886' of https://github.com/golenkovm/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Nov 26, 2019
2 parents ae2746b + ac8e6f8 commit 9a37e86
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1483,9 +1483,7 @@ public function initialise() {
}

// Give the local plugins a chance to include some navigation if they want.
foreach (get_plugin_list_with_function('local', 'extend_navigation') as $function) {
$function($this);
}
$this->load_local_plugin_navigation();

// Remove any empty root nodes
foreach ($this->rootnodes as $node) {
Expand Down Expand Up @@ -1517,6 +1515,15 @@ public function initialise() {
return true;
}

/**
* This function gives local plugins an opportunity to modify navigation.
*/
protected function load_local_plugin_navigation() {
foreach (get_plugin_list_with_function('local', 'extend_navigation') as $function) {
$function($this);
}
}

/**
* Returns true if the current user is a parent of the user being currently viewed.
*
Expand Down Expand Up @@ -3261,6 +3268,9 @@ public function initialise() {
$this->load_for_user(null, true);
}

// Give the local plugins a chance to include some navigation if they want.
$this->load_local_plugin_navigation();

$this->find_expandable($this->expandable);
return $this->expandable;
}
Expand Down

0 comments on commit 9a37e86

Please sign in to comment.