function advise_display_popup_change_term

6.x advise.module advise_display_popup_change_term()
4.x advise.module advise_display_popup_change_term()
5.x advise.module advise_display_popup_change_term()

This popup allows the advisor to change the advising term.

File

modules/advise/advise.module, line 421

Code

function advise_display_popup_change_term() {
  $rtn = "";

  fp_add_js(fp_get_module_path("advise") . "/js/advise.js");

  $current_term_id = $_REQUEST ["advising_term_id"];
  $current_term = get_term_description($current_term_id);


  $rtn .= fp_render_curved_line(t("Select an Advising Term"));
  $rtn .= "<div>
      " . t("You may advise this student for future semesters.  Please select which
      advising term you would like to advise for from the list below.  If you
      are unsure, simply close this window and continue to advise for the current
      term of %current_term.", array("%current_term" => $current_term)) . "
      </div>";

  $rtn .= "<ul>";

  $temp = explode(",", variable_get("available_advising_term_ids", "0"));
  for ($t = 0; $t < count($temp); $t++) {
    $term_id = trim($temp [$t]);


    $term_desc = get_term_description($term_id);
    if ($term_id == $current_term_id) {
      $term_desc = "<b>$term_desc</b> - " . t("current");
    }

    $link = fp_get_js_confirm_link(t("Are you sure you wish to change advising terms?"), "opener.changeTerm(\"$term_id\"); window.close(); ", $term_desc);

    $rtn .= "<li class='tenpt' style='padding:3px;'>$link</li>";

  }

  $rtn .= "</ul>";


  return $rtn;
}