[development] make messages appear just once
Adam Gregory
arcaneadam at gmail.com
Fri Nov 13 17:41:32 UTC 2009
You can check
$_SESSION['messages']
as that's where Drupal stores the messages.
-----
Adam A. Gregory
Blog: AdamAGregory.com
Twitter: twitter.com/adamgregory
Skype: aagregory2
Cell: 706.761.7375
2009/11/13 Lluís <enboig at gmail.com>
> I have some functions which throw info messages like "options saved".
> Sometimes I call them more than once, sometimes I call some of them;
> but I want the message appear just once. Where can I store if a
> message have been saved?
>
> Something like:
> <?php
>
> global $once_messages;
>
> $message="options saved";
> if (!$once_messages[$message]) {
> once_messages[$message]=TRUE;
> drupal_set_message($message);
> }
>
> ?>
>
> Any hint?
>
> thanks.
>
> --
> *Les normes hi són perquè hi pensis abans de saltar-te-les
> *La vida és com una taronja, què esperes a exprimir-la?
> *Si creus que l'educació és cara, prova la ignorància.
> *La vida és com una moneda, la pots gastar en el que vulguis però
> només una vegada.
> *Abans d'imprimir aquest missatge, pensa en el medi ambient.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20091113/c791e0a0/attachment.html
More information about the development
mailing list