function _AdvisingScreen::draw_popup_group_select_course_row

4.x _AdvisingScreen.php _AdvisingScreen::draw_popup_group_select_course_row(Course $course, $group_hours_remaining = 0)
5.x _AdvisingScreen.php _AdvisingScreen::draw_popup_group_select_course_row(Course $course, $group_hours_remaining = 0)

Used in the group selection popup, this will display a course with a radio button next to it, so the user can select it.

Parameters

Course $course:

int $group_hours_remaining:

Return value

string

1 call to _AdvisingScreen::draw_popup_group_select_course_row()
_AdvisingScreen::display_popup_group_select_course_list in classes/_AdvisingScreen.php
Accepts a CourseList object and draws it out to the screen. Meant to be called by display_popup_group_select();

File

classes/_AdvisingScreen.php, line 3266

Class

_AdvisingScreen

Code

function draw_popup_group_select_course_row(Course $course, $group_hours_remaining = 0) 
 {
  // Display a course itself...
  $pC = "";
  $w1_1 = $this->popup_width_array [0];
  $w1_2 = $this->popup_width_array [1];
  $w1_3 = $this->popup_width_array [2];
  $w2 = $this->popup_width_array [3];
  $w3 = $this->popup_width_array [4];
  $w4 = $this->popup_width_array [5];
  $w5 = $this->popup_width_array [6];
  $w6 = $this->popup_width_array [7];

  if ($course->subject_id == "") 
   {
    // Lacking course's display data, so reload it from the DB.
    $course->load_course($course->course_id);
  }


  $subject_id = $course->subject_id;
  $course_num = $course->course_num;
  $hours = $course->get_catalog_hours();
  $display_status = $course->display_status;
  $db_group_requirement_id = $course->db_group_requirement_id;
  $grade = $course->grade;
  $repeats = $course->specified_repeats;
  if ($repeats > 0) 
   {
    $w3 = "15%";
  }

  $course_id = $course->course_id;
  $group_id = $course->assigned_to_group_id;
  $semester_num = $course->assigned_to_semester_num;

  $var_hour_icon = " ";
  if ($course->has_variable_hours() == true) 
   {
    $var_hour_icon = "<img src='" . fp_theme_location() . "/images/var_hour.gif'
								title='" . t("This course has variable hours.") . "'
								alt='" . t("This course has variable hours.") . "'>";
  }


  $checked = "";
  if ($course->bool_selected == true) 
   {
    $checked = " checked='checked' ";
  }
  $op = "<input type='radio' name='course' value='$course_id' $checked>";
  $hid = "<input type='hidden' name='$course_id" . "_subject'
						id='$course_id" . "_subject' value='$subject_id'>
					<input type='hidden' name='$course_id" . "_db_group_requirement_id'
						id='$course_id" . "_db_group_requirement_id' value='$db_group_requirement_id'>";

  $blank_degree_id = "";
  if ($this->bool_blank) 
   {
    $blank_degree_id = $this->degree_plan->degree_id;
  }

  //$serializedCourse = urlencode(serialize($course));
  $js_code = "popupDescribeSelected(\"$group_id\",\"$semester_num\",\"$course_id\",\"$subject_id\",\"group_hours_remaining=$group_hours_remaining&db_group_requirement_id=$db_group_requirement_id&blank_degree_id=$blank_degree_id\");";

  $on_mouse_over = " onmouseover=\"style.backgroundColor='#FFFF99'\"
      				onmouseout=\"style.backgroundColor='white'\" ";

  if ($this->page_is_mobile) {
    $on_mouse_over = ""; // Causes problems for some mobile devices.
  }

  $hand_class = "hand";
  $extra_style = "";

  if ($course->bool_unselectable == true) 
   {
    // Cannot be selected, so remove that ability!
    $hand_class = "";
    $on_mouse_over = "";
    $js_code = "";
    $op = "";
    $extra_style = "style='font-style: italic; color:gray;'";
  }


  $pC .= "
   		<table border='0' cellpadding='0' width='100%' cellspacing='0' align='left'>
     	<tr height='20' class='$hand_class $display_status'
      		$on_mouse_over title='$title_text'>
      		<td width='$w1_1' align='left'>$op$hid</td>
      		<td width='$w1_2' align='left' onClick='$js_code'>$icon_link</td>
      		<td width='$w1_3' align='left' onClick='$js_code'>&nbsp;</td>
      		<td align='left' width='$w2' class='tenpt underline' 
      				onClick='$js_code' $extra_style>
       				$subject_id</td>
       		<td class='tenpt underline' $extra_style width='$w3' align='left' 
       			onClick='$js_code'>
        			$course_num</td>
        	";
  if ($repeats > 0) 
   {
    $pC .= "
				<td class='tenpt underline' style='color: gray;' 
					onClick='$js_code' colspan='3'>
				<i>" . t("May take up to") . " <span style='color: blue;'>" . ($repeats + 1) . "</span> " . t("times.") . "</i>
				</td>
			";
  }
  else {

    $pC .= "
	       <td class='tenpt underline' width='$w4' onClick='$js_code' $extra_style>$hours&nbsp;$var_hour_icon</td>
       	   <td class='tenpt underline' width='$w5' onClick='$js_code'>$grade&nbsp;</td>
       	   <td class='tenpt underline' width='$w6' onClick='$js_code'>$pts&nbsp;</td>
       	   ";
  }

  $pC .= "
     	</tr>
     	</table>";


  return $pC;
}