]> git.mjollnir.org Git - moodle.git/commitdiff
Merged new variable $CFG->allowvisiblecoursesinhiddencategories from stable
authormoodler <moodler>
Thu, 13 Jul 2006 14:18:29 +0000 (14:18 +0000)
committermoodler <moodler>
Thu, 13 Jul 2006 14:18:29 +0000 (14:18 +0000)
config-dist.php
lib/datalib.php

index fad1e5ec62ea0b5c80e4ed6b37487d58e1f9e05a..c34ef3c281f1f7ba21204e56fa404459103b39df 100644 (file)
@@ -281,6 +281,9 @@ $CFG->admin = 'admin';
 //
 //     $CFG->emailconnectionerrorsto = 'your@emailaddress.com';
 // 
+// Restore pre-1.6 behaviour where courses could still be available
+// even if the category they were in was hidden
+//     $CFG->allowvisiblecoursesinhiddencategories = true;
 // 
 // NOTE: if you are using custompix in your theme, see /fixpix.php.
 
index a8f1012a5ad65a0a6d8b1de922e17ffd9260bac1..264e278ed252db79b4ab0f44fe35962e728d7f56 100644 (file)
@@ -3111,6 +3111,12 @@ function check_db_compat() {
 }
 
 function course_parent_visible($course = null) {
+    if (empty($course)) {
+        return true;
+    }
+    if (!empty($CFG->allowvisiblecoursesinhiddencategories)) {
+        return true;
+    }
     return category_parent_visible($course->category);
 }