MDL-59599 navigation: Respect previous activity-level navigation

The original patch was overwriting grading methods navigation.

All credit goes to Andrew Nicols.
This commit is contained in:
David Monllao
2018-07-12 10:25:52 +08:00
committed by Andrew Nicols
parent 8b2ae94442
commit 24e83b2807
+1 -1
View File
@@ -2733,7 +2733,7 @@ class global_navigation extends navigation_node {
$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) {
if ($this->page->context->contextlevel < CONTEXT_MODULE && strpos($this->page->pagetype, 'grade-') === 0) {
$gradenode->make_active();
}
}