function _AdvisingScreenTypeView::match_requirement_type

4.x _AdvisingScreenTypeView.php _AdvisingScreenTypeView::match_requirement_type($test_type, $req_type)
5.x _AdvisingScreenTypeView.php _AdvisingScreenTypeView::match_requirement_type($test_type, $req_type)

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.

Parameters

string $test_type:

string $req_type:

Return value

bool

1 call to _AdvisingScreenTypeView::match_requirement_type()
_AdvisingScreenTypeView::display_semester_list in classes/_AdvisingScreenTypeView.php
Display contents of a semester list as a single semester, only displaying courses matching the requirement_type. If the requirement_type is "e", then we will also look for anything not containing a defined requirement_type.

File

classes/_AdvisingScreenTypeView.php, line 66

Class

_AdvisingScreenTypeView
This class is the View by Type view for FlightPath. As such, it inherits most of it's classes from __advising_screen.

Code

function match_requirement_type($test_type, $req_type) 
 {
  // Does the testType match the reqType?

  if ($test_type == $req_type) 
   {
    return true;
  }

  // Does it match if there's a u in front?
  if ($test_type == ("u" . $req_type)) 
   { // university captone type.
    return true;
  }

  if ($req_type == "e") 
   {
    // type "elective."  We will make sure the test_type isn't in
    // one of our defined types already.

    // Also, make sure it doesn't begin with a 'u'.  Ex:  um, for University Capstone + m.  That would be undefined as well.
    $no_u_test_type = ltrim($test_type, 'u');

    $types = fp_get_requirement_types();

    if (!isset($types [$test_type]) && !isset($types [$no_u_test_type])) {
      // Yes-- the user is using a code NOT defined, so let's just call it
      // an "elective" type.

      return TRUE;
    }


  }

  return false;

}