diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 53346f21b34..6f8a4dcba62 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -4212,7 +4212,7 @@ class settings_navigation extends navigation_node { if (empty($passwordchangeurl)) { $passwordchangeurl = new moodle_url('/login/change_password.php', array('id'=>$course->id)); } - $usersetting->add(get_string("changepassword"), $passwordchangeurl, self::TYPE_SETTING); + $usersetting->add(get_string("changepassword"), $passwordchangeurl, self::TYPE_SETTING, null, 'changepassword'); } // View the roles settings @@ -4330,6 +4330,12 @@ class settings_navigation extends navigation_node { $usersetting->add(get_string('loginas'), $url, self::TYPE_SETTING); } + // Let admin tools hook into user settings navigation. + $tools = get_plugin_list_with_function('tool', 'extend_navigation_user_settings', 'lib.php'); + foreach ($tools as $toolfunction) { + $toolfunction($usersetting, $user, $usercontext, $course, $coursecontext); + } + return $usersetting; } diff --git a/lib/upgrade.txt b/lib/upgrade.txt index b1690b06dfd..47bbe27b318 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -24,6 +24,7 @@ information provided here is intended especially for developers. it must be amended. It does not apply to lib/googleapi.php. See MDL-47297 * Added an extra parameter to the function get_formatted_help_string() (default null) which is used to specify additional string parameters. +* User settings node and course node in navigation now support callbacks from admin tools. DEPRECATIONS: * completion_info->get_incomplete_criteria() is deprecated and will be removed in Moodle 3.0.