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

Ingo Renner ingo at typo3.org
Wed Aug 12 20:31:35 CEST 2009


Hi *,

This is an SVN patch request.

Type: feature

Bugtracker references:
http://bugs.typo3.org/view.php?id=11684

Branches: trunk

Problem:
Currently there's no nice way to show notices, information, success, 
warning, or error messages to the user.

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.

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.

There're one thing I'd like to get comments on:
  * 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)


Notes:
Some of the code - the way how messages get added to the document (class 
template) - is taken from FLOW3. FLOW3 however, does not have a 
dedicated class to represent a flash message.

To test the messages you can use the attached test extension.

Usage example (backend module context):

$flashMessage = t3lib_div::makeInstance(
     't3lib_FlashMessage',
     $message, $title, $severity
);
$this->doc->pushFlashMessage($flashMessage);

The only thing required is the message, title is optional as well as the 
severity (defaults to OK)


all the best
Ingo

-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2



More information about the TYPO3-team-core mailing list