[TYPO3-core] RFC #11684: Add support for flash messages in the backend

Francois Suter fsu-lists at cobweb.ch
Tue Aug 18 23:54:48 CEST 2009


Hi,

> Solution:
> In the ruby on rails world they have a thing they call flash messages.
> Introducing these to the TYPO3 backend also gives us a nice way to show 
> mentioned messages.
> They're called "flash" message as they only live for the duration of a 
> request. Furthermore they can be improved in a second step to disapear 
> automatically after some time or can carry a small "close" link.

I'm attaching here a modified patch. I did 2 changes essentially:

- I think the rendering of the messages should include a bit more 
markup, as it will allow for better skinning. I have change the 
rendering to match the one originally proposed in the Usability team 
discussion.

- we discussed offline about the possibility of tagging messages, so 
that there's not a single queue but actually several. We agreed then 
that this could be postponed. However looking at the code you submitted, 
I found it very easy to add such feature, by adding an optional 
parameter to the queue management methods (pop, push, render and 
getFromSession). The tagging is optional. All message go to a default 
queue and that default queue still gets displayed at the top of a BE 
module's content. But it is also possible to call the 
template::renderFlashMessages() method manually (changed its visibility 
to public) in one's code to display another set of messages. I'm 
including a modified version of the test extension where you can see 
this in action.

> The icons need to be placed in typo3/gfx/. The notice message 
> intentionally doesn't have an icon as it's got very low severity.

I still wonder about this. It looks really empty without an icon. I 
would prefer if it had one.

>  * Currently neither title nor message are htmlspecialchars()ed to allow 
> a message to carry links or have lists like in the demo extension. 
> Should/can this stay like it is or should an optional parameter for both 
> set() methods be introduced to en/disable escaping (defaulting to escape 
> = true)

I don't really see a need to call htmlspecialchars() when instantiating 
a message. If a developer has doubts about the content of a message 
(because he repeats an input string, for example), he should call 
htmlspecialchars() first inside his code, before using that string 
inside a message.

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 11684-v2.patch
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090818/9b7a3ba2/attachment-0001.txt 


More information about the TYPO3-team-core mailing list