From 418b4e5a5f4b5128cf9efab59b6f967e89167e07 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 13 Jul 2006 14:18:29 +0000 Subject: [PATCH] Merged new variable $CFG->allowvisiblecoursesinhiddencategories from stable --- config-dist.php | 3 +++ lib/datalib.php | 6 ++++++ 2 files changed, 9 insertions(+) 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); } -- 2.39.5