From f37c3ec832b53c0d7b6e00ec49adaa35b02c7c95 Mon Sep 17 00:00:00 2001 From: Kathrin Osswald Date: Tue, 12 Jun 2018 12:48:41 +0200 Subject: [PATCH] MDL-59599 navigation: Improve activity status for nav nodes. --- lib/navigationlib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index f8208c809a1..f2f4cb10471 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -2730,7 +2730,12 @@ class global_navigation extends navigation_node { } if ($navoptions->grades) { $url = new moodle_url('/grade/report/index.php', array('id'=>$course->id)); - $gradenode = $coursenode->add(get_string('grades'), $url, self::TYPE_SETTING, null, 'grades', new pix_icon('i/grades', '')); + $gradenode = $coursenode->add(get_string('grades'), $url, self::TYPE_SETTING, null, + 'grades', new pix_icon('i/grades', '')); + // If the page type matches the grade part, then make the nav drawer grade node (incl. all sub pages) active. + if (strpos($this->page->pagetype, 'grade-') == 0) { + $gradenode->make_active(); + } } return true; -- 2.11.4.GIT