navigation MDL-25247 Fixed regression in the navigation.
authorSam Hemelryk <sam@moodle.com>
Wed, 17 Nov 2010 02:20:05 +0000 (02:20 +0000)
committerSam Hemelryk <sam@moodle.com>
Wed, 17 Nov 2010 02:20:05 +0000 (02:20 +0000)
lib/navigationlib.php

index c7ad1e7..b2791e9 100644 (file)
@@ -1015,7 +1015,7 @@ class global_navigation extends navigation_node {
                 // If the user is not enrolled then we only want to show the
                 // course node and not populate it.
                 $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
-                if (can_access_course($coursecontext)) {
+                if (!can_access_course($coursecontext)) {
                     if ($coursenode) {
                         $coursenode->make_active();
                     }
@@ -1070,7 +1070,7 @@ class global_navigation extends navigation_node {
                     // If the user is not enrolled then we only want to show the
                     // course node and not populate it.
                     $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
-                    if (can_access_course($coursecontext)) {
+                    if (!can_access_course($coursecontext)) {
                         $coursenode->make_active();
                         $canviewcourseprofile = false;
                         break;