From eccf301acf3e1e80064bf2dbdf39cee14bd814f1 Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Mon, 30 Jun 2014 13:08:38 +0800 Subject: [PATCH] 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 --- lib/navigationlib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 5359b56ed9e..179f2471b21 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -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)) {