function system_get_exclude_degree_ids_from_appears_in_counts

6.x system.module system_get_exclude_degree_ids_from_appears_in_counts($school_id)
5.x system.module system_get_exclude_degree_ids_from_appears_in_counts()

Uses the "exclude_majors...." setting, but converts them into an array of degree_ids.

2 calls to system_get_exclude_degree_ids_from_appears_in_counts()
_DegreePlan::get_max_course_appears_in_degrees_count in classes/_DegreePlan.php
Given a group_id, find out if this group contains a course which appears in other degrees. Return the max number.
_DegreePlan::load_degree_plan in classes/_DegreePlan.php
Load our complete degree plan, including all courses and groups.

File

modules/system/system.module, line 1659

Code

function system_get_exclude_degree_ids_from_appears_in_counts() {

  // Have we already cached this for this page load?  
  if (isset($GLOBALS ["exclude_degree_ids_from_appears_in_counts"])) {
    return $GLOBALS ["exclude_degree_ids_from_appears_in_counts"];
  }

  $db = get_global_database_handler();
  $rtn = array();
  $majors = csv_to_array(variable_get("exclude_majors_from_appears_in_counts", ""));

  foreach ($majors as $major_code) {
    $rtn = array_merge($rtn, $db->get_degree_ids($major_code));
  }


  $GLOBALS ["exclude_degree_ids_from_appears_in_counts"] = $rtn; // cache for next time.
  return $rtn;

}