Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved the new functions added for Bug #4074 to datalib.php

  • Loading branch information...
commit 0986271ba29fbbf7206197b4eb51c3cea58ae31d 1 parent 7c12225
patrickslee authored
Showing with 20 additions and 20 deletions.
  1. +0 −20 course/lib.php
  2. +20 −0 lib/datalib.php
View
20 course/lib.php
@@ -2038,24 +2038,4 @@ function move_courses ($courseids, $categoryid) {
return true;
}
-function course_parent_visible($course = null) {
- return category_parent_visible($course->category);
-}
-
-function category_parent_visible($parent = 0) {
- if (!$parent) {
- return true;
- }
- $category = get_record('course_categories', 'id', $parent);
- $list = explode('/', preg_replace('/^\/(.*)$/', '$1', $category->path));
- $list[] = $parent;
- $parents = get_records_list('course_categories', 'id', implode(',', $list), 'depth DESC');
- foreach ($parents as $parent) {
- if (!$parent->visible) {
- return false;
- }
- }
- return true;
-}
-
?>
View
20 lib/datalib.php
@@ -3060,5 +3060,25 @@ function check_db_compat() {
return true;
}
+function course_parent_visible($course = null) {
+ return category_parent_visible($course->category);
+}
+
+function category_parent_visible($parent = 0) {
+ if (!$parent) {
+ return true;
+ }
+ $category = get_record('course_categories', 'id', $parent);
+ $list = explode('/', preg_replace('/^\/(.*)$/', '$1', $category->path));
+ $list[] = $parent;
+ $parents = get_records_list('course_categories', 'id', implode(',', $list), 'depth DESC');
+ foreach ($parents as $parent) {
+ if (!$parent->visible) {
+ return false;
+ }
+ }
+ return true;
+}
+
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
?>
Please sign in to comment.
Something went wrong with that request. Please try again.