Project

General

Profile

Bug #23996 » 16318v4_PageRenderer.diff

Administrator Admin, 2010-11-13 23:31

View differences:

t3lib/class.t3lib_flashmessagequeue.php (working copy)
*/
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) {
self::addFadeOutEffectJavascript();
}
return $content;
}
/**
* Adds the Javascript for the flash messages fade out effect.
*
*/
protected static function addFadeOutEffectJavascript() {
$pageRenderer = t3lib_div::makeInstance('t3lib_PageRenderer');
$pageRenderer->addExtOnReadyCode('
Ext.select(".message-fade-out").each(function(message) {
message.pause(5).ghost("t", {remove:true});
});
');
}
}
t3lib/class.t3lib_flashmessage.php (working copy)
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.
......
}
/**
* 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.
......
$title = '<div class="message-header">' . $this->title . '</div>';
}
$message = '<div class="typo3-message message-' . $classes[$this->severity] . '">'
$message = '<div class="typo3-message '
. 'message-' . $classes[$this->severity] . ' '
. implode(' ', $this->additionalCssClasses)
. '">'
. $title
. '<div class="message-body">' . $this->message . '</div>'
. '</div>';
. '</div>';
return $message;
}
(3-3/3)