- Modified patch #7958 by Adrian: store status messages in a session so they can persist when redirection is used.
parent
d09023164e
commit
2e67c2ffa1
|
@ -40,17 +40,22 @@ function drupal_get_title() {
|
|||
* @{
|
||||
*/
|
||||
function drupal_set_message($message = NULL, $type = "status") {
|
||||
static $stored_message = array();
|
||||
|
||||
if (isset($message)) {
|
||||
$stored_message[] = array($message, $type);
|
||||
if (!isset($_SESSION['messages'])) {
|
||||
$_SESSION['messages'] = array();
|
||||
}
|
||||
|
||||
return $stored_message;
|
||||
if (isset($message)) {
|
||||
$_SESSION['messages'][] = array($message, $type);
|
||||
}
|
||||
|
||||
return $_SESSION['messages'];
|
||||
}
|
||||
|
||||
function drupal_get_messages() {
|
||||
return drupal_set_message();
|
||||
$messages = drupal_set_message();
|
||||
$_SESSION['messages'] = array();
|
||||
|
||||
return $messages;
|
||||
}
|
||||
/* @} */
|
||||
|
||||
|
|
Loading…
Reference in New Issue