1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-25 10:26:17 +02:00

MDL-45758 navigation: updates to navigation

This patch does the following:-
Start using proper key for course report node
Allow admin tools to hook into course navigation

Original issue - MDL-46131
This commit is contained in:
Ankit Agarwal 2014-06-30 13:08:38 +08:00
parent 5f68d9ee2b
commit eccf301acf

@ -3753,7 +3753,7 @@ class settings_navigation extends navigation_node {
// View course reports.
if (has_capability('moodle/site:viewreports', $coursecontext)) { // Basic capability for listing of reports.
$reportnav = $coursenode->add(get_string('reports'), null, self::TYPE_CONTAINER, null, null,
$reportnav = $coursenode->add(get_string('reports'), null, self::TYPE_CONTAINER, null, 'coursereports',
new pix_icon('i/stats', ''));
$coursereports = core_component::get_plugin_list('coursereport');
foreach ($coursereports as $report => $dir) {
@ -3773,6 +3773,12 @@ class settings_navigation extends navigation_node {
}
}
// Let admin tools hook into course navigation.
$tools = get_plugin_list_with_function('tool', 'extend_navigation_course', 'lib.php');
foreach ($tools as $toolfunction) {
$toolfunction($coursenode, $course, $coursecontext);
}
// Add view grade report is permitted
$reportavailable = false;
if (has_capability('moodle/grade:viewall', $coursecontext)) {