MDL-33063 course: Reuse get_all_sections()
authorAaron Barnes <aaronb@catalyst.net.nz>
Thu, 17 May 2012 03:40:03 +0000 (15:40 +1200)
committerAaron Barnes <aaronb@catalyst.net.nz>
Thu, 17 May 2012 03:40:03 +0000 (15:40 +1200)
course/lib.php

index 382ae35..2599958 100644 (file)
@@ -1066,7 +1066,7 @@ function get_array_of_activities($courseid) {
         return $mod; // always return array
     }
 
         return $mod; // always return array
     }
 
-    if ($sections = $DB->get_records("course_sections", array("course"=>$courseid), "section ASC")) {
+    if ($sections = get_all_sections($courseid)) {
        foreach ($sections as $section) {
            if (!empty($section->sequence)) {
                $sequence = explode(",", $section->sequence);
        foreach ($sections as $section) {
            if (!empty($section->sequence)) {
                $sequence = explode(",", $section->sequence);