Merged new variable $CFG->allowvisiblecoursesinhiddencategories from stable

This commit is contained in:
moodler 2006-07-13 14:18:29 +00:00
parent a36f058e53
commit 418b4e5a5f
2 changed files with 9 additions and 0 deletions

View 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.

View 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);
}