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 1905

Code

function system_get_exclude_degree_ids_from_appears_in_counts($school_id) {

  $rtn = array();

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

  $db = get_global_database_handler();

  $majors = csv_to_array(variable_get_for_school("exclude_majors_from_appears_in_counts", "", $school_id));

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


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

  return $rtn;

}