function fp_add_message

7.x misc.inc fp_add_message($msg, $type = "status", $bool_no_repeat = FALSE)
6.x misc.inc fp_add_message($msg, $type = "status", $bool_no_repeat = FALSE)
4.x misc.inc fp_add_message($msg, $type = "status", $bool_no_repeat = FALSE)
5.x misc.inc fp_add_message($msg, $type = "status", $bool_no_repeat = FALSE)

Add a "message" to the top of the screen. Useful for short messages like "You have been logged out" or "Form submitted successfully."

Parameters

String $msg: This is the string message itself.

String $type: The "type" of message. This string is added as a CSS class to the message, for theming later.

boolean $bool_no_repeat: Boolean. Should the message show more than once per page view? Set to TRUE if it should NOT.

51 calls to fp_add_message()
admin_add_degree_form_submit in modules/admin/admin.degrees.inc
Submit handler for the add_degree_form.
admin_apply_draft_changes_form_submit in modules/admin/admin.module
Handles the actual moving of draft courses into production.
admin_copy_degree_form_submit in modules/admin/admin.degrees.inc
admin_duplicate_year_form_submit in modules/admin/admin.module
This function should perform the actual copy of data!
admin_edit_course_form_submit in modules/admin/admin.courses.inc

... See full list

File

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

Code

function fp_add_message($msg, $type = "status", $bool_no_repeat = FALSE) {

  $md5 = md5($type . $msg);

  if ($bool_no_repeat && isset($_SESSION ["fp_messages"]) && is_array($_SESSION ["fp_messages"])) {
    // Make sure this message isn't already in the session.
    foreach ($_SESSION ["fp_messages"] as $s) {
      if ($s ["md5"] == $md5) {
        return;
      }
    }
  }


  $_SESSION ["fp_messages"][] = array("type" => $type, "msg" => $msg, "md5" => $md5);
}