MDL-45758 tool_monitor: Update navigation to add callbacks
User settings node now checks for callbacks in various admin tools
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user