}
// Start the list item, and print the context name as a link to the place to make changes.
- if ($contextid == context_system::instance()->id) {
+ $context = context::instance_by_id($contextid);
+
+ if ($context instanceof context_system) {
$url = new moodle_url('/admin/roles/manage.php');
- $title = get_string('changeroles', 'tool_capability');
} else {
- $url = new moodle_url('/admin/roles/override.php', array('contextid' => $contextid));
- $title = get_string('changeoverrides', 'tool_capability');
+ $url = new moodle_url('/admin/roles/permissions.php', ['contextid' => $contextid]);
}
- $context = context::instance_by_id($contextid);
- $html = $this->output->heading(html_writer::link($url, $context->get_context_name(), array('title' => $title)), 3);
+
+ $title = get_string('permissionsincontext', 'core_role', $context->get_context_name());
+
+ $html = $this->output->heading(html_writer::link($url, $title), 3);
$html .= html_writer::table($table);
// If there are any child contexts, print them recursively.
if (!empty($contexts[$contextid]->children)) {
return $html;
}
-}
\ No newline at end of file
+}