drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE)
drupal/includes/bootstrap.inc, line 1681
Set a message which reflects the status of the performed operation.
If the function is called with no arguments, this function returns all set messages without clearing them.
$message The message should begin with a capital letter and always ends with a period '.'.
$type The type of the message. One of the following values are possible:
function drupal_set_message($message = NULL, $type = 'status', $repeat = TRUE) {
if ($message) {
if (!isset($_SESSION['messages'][$type])) {
$_SESSION['messages'][$type] = array();
}
if ($repeat || !in_array($message, $_SESSION['messages'][$type])) {
$_SESSION['messages'][$type][] = $message;
}
// Mark this page as being uncacheable.
drupal_page_is_cacheable(FALSE);
}
// Messages not set when DB connection fails.
return isset($_SESSION['messages']) ? $_SESSION['messages'] : NULL;
}