Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 0986271ba29fbbf7206197b4eb51c3cea58ae31d 1 parent 7c12225
authored
20  course/lib.php
@@ -2038,24 +2038,4 @@ function move_courses ($courseids, $categoryid) {
2038 2038
     return true;
2039 2039
 }
2040 2040
 
2041  
-function course_parent_visible($course = null) {
2042  
-    return category_parent_visible($course->category);
2043  
-}
2044  
-
2045  
-function category_parent_visible($parent = 0) {
2046  
-    if (!$parent) {
2047  
-        return true;
2048  
-    }
2049  
-    $category = get_record('course_categories', 'id', $parent);
2050  
-    $list = explode('/', preg_replace('/^\/(.*)$/', '$1', $category->path));
2051  
-    $list[] = $parent;
2052  
-    $parents = get_records_list('course_categories', 'id', implode(',', $list), 'depth DESC');
2053  
-    foreach ($parents as $parent) {
2054  
-        if (!$parent->visible) {
2055  
-            return false;
2056  
-        }
2057  
-    }
2058  
-    return true;
2059  
-}
2060  
-
2061 2041
 ?>
20  lib/datalib.php
@@ -3060,5 +3060,25 @@ function check_db_compat() {
3060 3060
     return true;
3061 3061
 }
3062 3062
 
  3063
+function course_parent_visible($course = null) {
  3064
+    return category_parent_visible($course->category);
  3065
+}
  3066
+
  3067
+function category_parent_visible($parent = 0) {
  3068
+    if (!$parent) {
  3069
+        return true;
  3070
+    }
  3071
+    $category = get_record('course_categories', 'id', $parent);
  3072
+    $list = explode('/', preg_replace('/^\/(.*)$/', '$1', $category->path));
  3073
+    $list[] = $parent;
  3074
+    $parents = get_records_list('course_categories', 'id', implode(',', $list), 'depth DESC');
  3075
+    foreach ($parents as $parent) {
  3076
+        if (!$parent->visible) {
  3077
+            return false;
  3078
+        }
  3079
+    }
  3080
+    return true;
  3081
+}
  3082
+
3063 3083
 // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
3064 3084
 ?>

0 notes on commit 0986271

Please sign in to comment.
Something went wrong with that request. Please try again.