function _Student::get_rank_description
Search API
4.x _Student.php | _Student::get_rank_description($rank_code = "") |
5.x _Student.php | _Student::get_rank_description($rank_code = "") |
Given a rank_code like FR, SO, etc., get the english description. For example: Freshman, Sophomore, etc.
1 call to _Student::get_rank_description()
- _Student::load_student_data in classes/
_Student.php - This loads a student's personal data, like name and so forth.
File
- classes/
_Student.php, line 575
Class
Code
function get_rank_description($rank_code = "") {
// Get our rank descriptions from our setting.
$temp = variable_get("rank_descriptions", "FR ~ Freshman\nSO ~ Sophomore\nJR ~ Junior\nSR ~ Senior\nPR ~ Professional\nGR ~ Graduate");
$lines = explode("\n", $temp);
foreach ($lines as $line) {
$temp = explode("~", $line);
$rank_array [trim($temp [0])] = trim($temp [1]);
}
$rank_desc = @$rank_array [$rank_code];
// If a description isn't found, just return the code itself.
if ($rank_desc == '') {
$rank_desc = $rank_code;
}
return $rank_desc;
}