From be6c8dfe5ad725fe2ec77db546d96a34dd205c57 Mon Sep 17 00:00:00 2001 From: samhemelryk Date: Mon, 7 Sep 2009 03:16:52 +0000 Subject: [PATCH] navigation MDL-14632 Fixed bug whereby active module may not be marked as active --- lib/navigationlib.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index a1fa270ef4b..fca1f755cbc 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -795,7 +795,7 @@ class global_navigation extends navigation_node { case CONTEXT_COURSE: $depth = $this->load_for_course(); break; - case CONTEXT_MODULE: + case CONTEXT_MODULE: $depth = $this->load_for_activity(); break; case CONTEXT_USER: @@ -1090,17 +1090,15 @@ class global_navigation extends navigation_node { return; } - $this->context = $PAGE->course->context; - - $file = $CFG->dirroot.'/mod/'.$module->name.'/lib.php'; - $function = $module->name.'_extend_navigation'; - - if (file_exists($file)) { - require_once($file); - if (function_exists($function)) { - $node = $this->find_child($PAGE->cm->id, self::TYPE_ACTIVITY); - if ($node) { - $node->make_active(); + $node = $this->find_child($PAGE->cm->id, self::TYPE_ACTIVITY); + if ($node) { + $node->make_active(); + $this->context = $PAGE->course->context; + $file = $CFG->dirroot.'/mod/'.$module->name.'/lib.php'; + $function = $module->name.'_extend_navigation'; + if (file_exists($file)) { + require_once($file); + if (function_exists($function)) { $function($node, $PAGE->course, $module, $PAGE->cm); } }