function fp_get_js_alert_link

7.x misc.inc fp_get_js_alert_link($message, $link_text = NULL, $extra_css_class = "")
6.x misc.inc fp_get_js_alert_link($message, $link_text = "", $extra_css_class = "")
4.x misc.inc fp_get_js_alert_link($message, $link_text, $extra_css_class = "")
5.x misc.inc fp_get_js_alert_link($message, $link_text = "", $extra_css_class = "")

Creates a javascript "alert" link, which tells the user some message with javascript alert().

Similar to the fp_get_js_confirm_link function, but this is a simple alert message, with no user input.

See also

fp_get_js_confirm_link

4 calls to fp_get_js_alert_link()
admin_display_edit_degree in modules/admin/admin.degrees.inc
This screen displays the form which allows the user to actually edit a degree.
admin_display_groups_popup_edit_definition in modules/admin/admin.groups.inc
fp_render_element in includes/render.inc
Returns the HTML to render this form (or content) element to the screen. $name is the HTML machine name. $element is an array containing all we need to render it. If you want default values to be taken from the SESSION (because we had form_errors,…
_AdvisingScreen::display_popup_substitute in classes/_AdvisingScreen.php
This is used to display the substitution popup to a user, to let them actually make a substitution.

File

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

Code

function fp_get_js_alert_link($message, $link_text = "", $extra_css_class = "") {

  $rtn = "";

  if ($link_text == "") {
    $link_text = "[?]";
  }

  $message = fp_reduce_whitespace($message);

  $message = str_replace("\n", "[NL]", $message);
  $message = htmlentities($message, ENT_QUOTES);
  $message = str_replace(""", "\"", $message);
  $message = str_replace("[NL]", "\\n", $message);

  $rtn .= "<a href='javascript: alert(\"" . $message . "\");' class='fp-alert-link $extra_css_class'>$link_text</a>";


  return $rtn;

}