function fp_get_js_confirm_link

7.x misc.inc fp_get_js_confirm_link($question, $action_if_yes, $link_text, $extra_class = "", $link_title = "")
6.x misc.inc fp_get_js_confirm_link($question, $action_if_yes, $link_text, $extra_class = "", $link_title = "")
4.x misc.inc fp_get_js_confirm_link($question, $action_if_yes, $link_text)
5.x misc.inc fp_get_js_confirm_link($question, $action_if_yes, $link_text)

Creates a javascript "confirm" link, so when clicked it asks the user a question, then proceeds if they select OK. The main reason I want to do this is so I can pass the $question through my t() function. (do it when you call this function)

11 calls to fp_get_js_confirm_link()
advise_display_history in modules/advise/advise.history.inc
Displays the history tab on screen.
advise_display_popup_change_term in modules/advise/advise.module
This popup allows the advisor to change the advising term.
advise_display_popup_change_track in modules/advise/advise.module
advise_display_popup_change_track_non_dynamic_degree in modules/advise/advise.module
This is the "change track" popup we will display if the degree cannot be combined with anything else (non-dynamic).
audit_display_audit in modules/audit/audit.module

... See full list

File

includes/misc.inc, line 2726
This file contains misc functions for FlightPath

Code

function fp_get_js_confirm_link($question, $action_if_yes, $link_text, $extra_class = "", $link_title = "") {

  $rtn = "";

  $question = fp_reduce_whitespace($question);

  //$question = htmlentities($question, ENT_QUOTES);
  //$question = str_replace("\n", "\\n", $question);

  $question = str_replace("\\n", "<br>", $question);
  $question = str_replace("\n", "<br>", $question);
  $question_64 = base64_encode($question); // convert to base_64 so we can have HTML


  $link_title = htmlentities($link_title, ENT_QUOTES);

  //$rtn .= "<a href='javascript: if(fp_confirm(\"$question\")) { $action_if_yes;  }' class='$extra_class' title='$link_title'>$link_text</a>";

  // Using new fp_confirm code
  $action_if_yes_64 = base64_encode($action_if_yes);
  $rtn .= "<a href='javascript: fp_confirm(\"$question_64\",\"base64\",\"$action_if_yes_64\");' class='$extra_class' title='$link_title'>$link_text</a>";


  return $rtn;
}