Index: t3lib/class.t3lib_flashmessagequeue.php =================================================================== --- t3lib/class.t3lib_flashmessagequeue.php (revision 9373) +++ t3lib/class.t3lib_flashmessagequeue.php (working copy) @@ -108,17 +108,35 @@ */ public static function renderFlashMessages() { $content = ''; + $addFadeOutEffectJavascript = FALSE; $flashMessages = self::getAllMessagesAndFlush(); if (count($flashMessages)) { foreach ($flashMessages as $flashMessage) { + if ($flashMessage->getSeverity() <= t3lib_FlashMessage::OK) { + $flashMessage->addCssClass('message-fade-out'); + $addFadeOutEffectJavascript = TRUE; + } + $content .= $flashMessage->render(); } } + + if ($addFadeOutEffectJavascript) { + $content .= LF . ''; + } + return $content; } - } Index: t3lib/class.t3lib_flashmessage.php =================================================================== --- t3lib/class.t3lib_flashmessage.php (revision 9373) +++ t3lib/class.t3lib_flashmessage.php (working copy) @@ -43,6 +43,13 @@ protected $storeInSession = FALSE; /** + * Additional CSS classes to use when rendering the flash message. + * + * @var array + */ + protected $additionalCssClasses = array(); + + /** * Constructor for a flash message * * @param string The message. @@ -80,6 +87,15 @@ } /** + * Adds a CSS class when rendering the flash message. + * + * @param string The CSS class to add + */ + public function addCssClass($cssClass) { + $this->additionalCssClasses[] = htmlspecialchars($cssClass); + } + + /** * Renders the flash message. * * @return string The flash message as HTML. @@ -98,10 +114,14 @@ $title = '
' . $this->title . '
'; } - $message = '
' + $message = '
' + . $title . '
' . $this->message . '
' - . '
'; + . '
'; return $message; }