function fp_get_requirement_types
Search API
7.x misc.inc | fp_get_requirement_types($school_id) |
6.x misc.inc | fp_get_requirement_types( |
5.x misc.inc | fp_get_requirement_types() |
Returns back an array of all the available requirement types (by code) that have been defined.
5 calls to fp_get_requirement_types()
- 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.
- DegreePlan::calculate_progress_quality_points in classes/
DegreePlan.php - Calculate the quality points of our completed courses, so we can use that to figure out GPA.
File
- includes/
misc.inc, line 1473 - This file contains misc functions for FlightPath
Code
function fp_get_requirement_types($school_id) {
$rtn = array();
if (isset($GLOBALS ['fp_temp_cache']['fp_get_requirement_types'][$school_id])) {
return $GLOBALS ['fp_temp_cache']['fp_get_requirement_types'][$school_id];
}
$temp = explode("\n", variable_get_for_school("requirement_types", "g ~ General Requirements\nc ~ Core Requirements\ne ~ Electives\nm ~ Major Requirements\ns ~ Supporting Requirements\nx ~ Additional Requirements", $school_id));
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'][$school_id] = $rtn;
return $rtn;
}