function _AdvisingScreen::build_graduate_credit

5.x _AdvisingScreen.php _AdvisingScreen::build_graduate_credit()

Constructs the HTML which will be used to display the student's graduate credits (if any exist)

1 call to _AdvisingScreen::build_graduate_credit()
_AdvisingScreen::build_screen_elements in classes/_AdvisingScreen.php
This function calls the other "build" functions to assemble the View or What If tabs in FlightPath.

File

classes/_AdvisingScreen.php, line 482

Class

_AdvisingScreen

Code

function build_graduate_credit() 
 {
  $pC = "";
  $is_empty = true;
  $pC .= $this->draw_semester_box_top(variable_get("graduate_credits_block_title", t("Graduate Credits")), FALSE);
  // Basically, go through all the courses the student has taken,
  // And only show the graduate credits.  Similar to build_transfer_credits

  $graduate_level_codes_array = csv_to_array(variable_get("graduate_level_codes", "GR"));


  $this->student->list_courses_taken->sort_alphabetical_order(false, true);
  $this->student->list_courses_taken->reset_counter();
  while ($this->student->list_courses_taken->has_more()) 
   {
    $course = $this->student->list_courses_taken->get_next();

    // Skip non graduate credits.
    if (!in_array($course->level_code, $graduate_level_codes_array)) 
     {
      continue;
    }

    // Tell the course_row what group we are coming from. (in this case: none)
    $course->disp_for_group_id = "";

    $pC .= $this->draw_course_row($course, "", "", false, false, false, true);
    $is_empty = FALSE;

  }

  $notice = trim(variable_get("graduate_credits_block_notice", t("These courses may not be used for undergraduate credit.")));

  // Do we have a notice to display?
  if ($notice != "") 
   {
    $pC .= "<tr><td colspan='8'>
					<div class='hypo tenpt' style='margin-top: 15px; padding: 5px;'>
						<b>" . t("Important Notice:") . "</b> $notice
					</div>
					</td></tr>";
  }


  $pC .= $this->draw_semester_box_bottom();

  if (!$is_empty) 
   {
    $this->add_to_screen($pC, "GRADUATE_CREDIT");
  }

}