function fp_get_requirement_types

6.x misc.inc fp_get_requirement_types($school_id)
5.x misc.inc fp_get_requirement_types()

Returns back an array of all the available requirement types (by code) that have been defined.

6 calls to fp_get_requirement_types()
admin_display_degrees_popup_add_group in modules/admin/admin.degrees.inc
admin_display_degrees_popup_add_group2 in modules/admin/admin.degrees.inc
_AdvisingScreenTypeView::build_semester_list in classes/_AdvisingScreenTypeView.php
In __advising_screen, this method simply displays the degree plan's semesters to the screen. But here, we need to go through the type categories: ex: Core, Major, Supporting, and Electives, and only display courses and groups from each semester…
_AdvisingScreenTypeView::match_requirement_type in classes/_AdvisingScreenTypeView.php
Does the testType match the reqType? This function is used to make sure that courses or groups with a certain requirement_type are placed in the correct semester blocks on screen.
_DegreePlan::calculate_progress_hours in classes/_DegreePlan.php
Calculate and store progress hour information. Stores in the $this->gpa_calculations array.

... See full list

File

includes/misc.inc, line 895
This file contains misc functions for FlightPath

Code

function fp_get_requirement_types() {
  $rtn = array();

  if (isset($GLOBALS ['fp_temp_cache']['fp_get_requirement_types'])) {
    return $GLOBALS ['fp_temp_cache']['fp_get_requirement_types'];
  }


  $temp = explode("\n", variable_get("requirement_types", "g ~ General Requirements\nc ~ Core Requirements\ne ~ Electives\nm ~ Major Requirements\ns ~ Supporting Requirements\nx ~ Additional Requirements"));
  foreach ($temp as $line) {
    $line = trim($line);
    if ($line == "") {
      continue;
    }

    $temp = explode("~", $line);
    $code = trim(strtolower($temp [0]));
    $desc = trim($temp [1]);

    $rtn [$code] = $desc;

  }

  // Make sure that code 'x' is set.
  if (!isset($rtn ["x"])) {
    $rtn ["x"] = t("Additional Requirements");
  }

  // Make sure code 'e' for Electives is set.
  if (!isset($rtn ["e"])) {
    $rtn ["e"] = t("Electives");
  }

  // Make sure code 'm' is set, for Major Requirements, our default type.
  if (!isset($rtn ["m"])) {
    $rtn ["m"] = t("Major Requirements");
  }

  $GLOBALS ['fp_temp_cache']['fp_get_requirement_types'] = $rtn;

  return $rtn;

}