1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-23 09:23:09 +02:00

Merge branch 'master_MDL-56886' of https://github.com/golenkovm/moodle

This commit is contained in:
Jun Pataleta 2019-11-26 22:32:48 +08:00
commit 9a37e86c6b

@ -1483,9 +1483,7 @@ class global_navigation extends navigation_node {
}
// 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) {
@ -1517,6 +1515,15 @@ class global_navigation extends navigation_node {
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.
*
@ -3261,6 +3268,9 @@ class global_navigation_for_ajax extends global_navigation {
$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;
}