From: moodler Date: Thu, 13 Jul 2006 14:18:29 +0000 (+0000) Subject: Merged new variable $CFG->allowvisiblecoursesinhiddencategories from stable X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=418b4e5a5f4b5128cf9efab59b6f967e89167e07;p=moodle.git Merged new variable $CFG->allowvisiblecoursesinhiddencategories from stable --- diff --git a/config-dist.php b/config-dist.php index fad1e5ec62..c34ef3c281 100644 --- a/config-dist.php +++ b/config-dist.php @@ -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. diff --git a/lib/datalib.php b/lib/datalib.php index a8f1012a5a..264e278ed2 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -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); }