function fp_get_js_alert_link

7.x misc.inc fp_get_js_alert_link($message, $link_text = NULL, $extra_css_class = "", $link_title = "View help for this item")
6.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

8 calls to fp_get_js_alert_link()
admin.degrees.inc in modules/admin/admin.degrees.inc
admin.groups.inc in modules/admin/admin.groups.inc
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,…

... See full list

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;

}