admin_get_course_array_from_course_id_array

4.x admin.groups.inc admin_get_course_array_from_course_id_array($course_idArray)
1 call to admin_get_course_array_from_course_id_array()

File

modules/admin/admin.groups.inc, line 509

Code

function admin_get_course_array_from_course_id_array($course_idArray) {

  // Convert an array of course_id's into their subject_id ~~ course_num format.
  // Pick non-excluded courses over excluded courses, when you have the option.
  $rtn_array = array();
  $db = new DatabaseHandler();


  // MUST use foreach since we used array_unique earlier.  Can't use
  // count($arr) after you use array_unique!!
  foreach ($course_idArray as $t => $value) {
    $new_course = new Course();
    $new_course->bool_use_draft = true;
    $new_course->db = $db;
    $new_course->course_id = $course_idArray[$t];
    $new_course->load_descriptive_data(false);
    array_push($rtn_array, "$new_course->subject_id ~~ $new_course->course_num");
  }
  return $rtn_array;

}