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:
Ankit Agarwal 2014-10-13 11:54:31 +05:30
parent e8a925a60e
commit b9ba26b222
2 changed files with 8 additions and 1 deletions

View File

@ -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;
}

View File

@ -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.