]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed capability soring on course and coursecat override MDL-6780
authormoodler <moodler>
Mon, 2 Oct 2006 08:57:00 +0000 (08:57 +0000)
committermoodler <moodler>
Mon, 2 Oct 2006 08:57:00 +0000 (08:57 +0000)
lib/accesslib.php

index a9a241889c737e98f364b5caad018acb5e4cd472..c1567fb876892b1f07741238685008e936eb6e98 100755 (executable)
@@ -2124,7 +2124,7 @@ function fetch_context_capabilities($context) {
 /// the rest of code is a bit hacky, think twice before modifying it :-(
 
     // special sorting of core system capabiltites and enrollments
-    if ($context->contextlevel == CONTEXT_SYSTEM) {
+    if (in_array($context->contextlevel, array(CONTEXT_SYSTEM, CONTEXT_COURSECAT, CONTEXT_COURSE))) {
         $first = array();
         foreach ($records as $key=>$record) {
             if (preg_match('|^moodle/|', $record->name) and $record->contextlevel == CONTEXT_SYSTEM) {