Added feature #15991: Style error messages in the TYPO3 way
authorSteffen Gebert <steffen.gebert@typo3.org>
Mon, 18 Oct 2010 16:23:16 +0000 (16:23 +0000)
committerSteffen Gebert <steffen.gebert@typo3.org>
Mon, 18 Oct 2010 16:23:16 +0000 (16:23 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9145 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/error/class.t3lib_error_productionexceptionhandler.php
t3lib/message/class.t3lib_message_errorpagemessage.php
typo3/sysext/t3skin/stylesheets/standalone/errorpage-message.css [new file with mode: 0644]
typo3/sysext/t3skin/templates/errorpage-message.html [new file with mode: 0644]

index 85352cb..ab04d64 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-10-18  Steffen Gebert  <steffen@steffen-gebert.de>
+
+       * Added feature #15991: Style error messages in the TYPO3 way
+
 2010-10-18  Xavier Perseguers  <typo3@perseguers.ch>
 
        * Fixed bug #1318: 'removeTag' does not remove closing tags
index 36e9fb8..c36a3e6 100644 (file)
@@ -55,7 +55,8 @@ class t3lib_error_ProductionExceptionHandler extends t3lib_error_AbstractExcepti
                        header("HTTP/1.1 500 Internal Server Error");
                }
                $this->writeLogEntries($exception,self::CONTEXT_WEB);
-               $messageObj = t3lib_div::makeInstance('t3lib_message_ErrorPageMessage', $exception->getMessage(), get_class($exception));
+                       // we use a nice-looking title for our visitors instead of the exception's class name
+               $messageObj = t3lib_div::makeInstance('t3lib_message_ErrorPageMessage', $exception->getMessage(), 'Oops, an error occured!');
                $messageObj->output();
        }
 
index 85315d3..61de668 100644 (file)
@@ -53,7 +53,7 @@ class t3lib_message_ErrorpageMessage extends t3lib_message_AbstractMessage {
         * @return      void
         */
        public function __construct($message, $title, $severity = self::ERROR) {
-               $this->htmlTemplate = TYPO3_mainDir . 'templates/errorpage.html';
+               $this->htmlTemplate = TYPO3_mainDir . 'sysext/t3skin/templates/errorpage-message.html';
                $this->setMessage($message);
                $this->setTitle(strlen($title) > 0 ? $title : 'Error!');
                $this->setSeverity($severity);
@@ -95,10 +95,10 @@ class t3lib_message_ErrorpageMessage extends t3lib_message_AbstractMessage {
                
                $markers = array(
                        '###CSS_CLASS###' => $classes[$this->severity],
-                       '###LOGO###'      => '<img src="' . TYPO3_mainDir . 'gfx/typo3logo.gif" width="123" height="34" alt="" />',
                        '###TITLE###'     => $this->title,
                        '###MESSAGE###'   => $this->message,
-                       '###BASEURL###'   => t3lib_div::getIndpEnv('TYPO3_SITE_URL')
+                       '###BASEURL###'   => t3lib_div::getIndpEnv('TYPO3_SITE_URL'),
+                       '###TYPO3_mainDir###' => TYPO3_mainDir,
                );
 
                $content = t3lib_div::getUrl(PATH_site . $this->htmlTemplate);
diff --git a/typo3/sysext/t3skin/stylesheets/standalone/errorpage-message.css b/typo3/sysext/t3skin/stylesheets/standalone/errorpage-message.css
new file mode 100644 (file)
index 0000000..cbefba8
--- /dev/null
@@ -0,0 +1,115 @@
+* {
+       padding: 0;
+       margin: 0;
+}
+
+body {
+       color: #000000;
+       font-family: Verdana,Arial,Helvetica,sans-serif;
+       font-size: 11px;
+       line-height: 14px;
+}
+
+.t3-message-page {
+       background: url("../../images/login/background.png") repeat-x fixed 0 0 #4f4f4f;
+       padding-bottom: 20px;
+       padding-top: 75px;
+}
+
+.t3-errorpage-message .t3-message-page-logo {
+       background-image: url("../../images/login/typo3logo-white-greyback.gif");
+       background-position: right;
+       background-repeat: no-repeat;
+       height: auto;
+       margin: 0 0 30px;
+       padding: 0;
+       -moz-transform: rotate(180deg);
+       -o-transform: rotate(180deg);
+       -webkit-transform: rotate(180deg);
+       transform: rotate(180deg);
+}
+
+.t3-errorpage-message .t3-message-page-logo img {
+       visibility: hidden;
+}
+
+.t3-message-page-container {
+       color: #606060;
+       font-size: 11px;
+       text-align: left;
+       margin: 30px 16% 10px;
+       width: 456px;
+}
+
+.t3-errorpage-message .typo3-message {
+       background-position: 10px 12px;
+       background-repeat: no-repeat;
+       border: 1px solid;
+       padding: 12px 12px 12px 36px;
+}
+
+.t3-errorpage-message .message-error {
+       background-color: #f6d3cf;
+       background-image: url("../../images/icons/status/dialog-error.png");
+       border-color: #d66c68;
+       color: #aa0225;
+}
+
+.message-error a {
+       color: #aa0225;
+}
+
+.message-error a:hover {
+       color: #000000;
+}
+
+.t3-errorpage-message .t3-message-page-message {
+       background-position: 20px 20px;
+       padding-left: 45px;
+       padding-bottom: 20px;
+}
+
+.t3-errorpage-message h1 {
+       font-size: 15px;
+       margin-top: 9px;
+       margin-bottom: 25px;
+}
+
+.t3-message-page p.t3-error-text {
+       font-weight: bold;
+}
+
+#t3-footer {
+       border-top: 1px solid #5c5c5c;
+       font-size: 10px;
+       margin: 40px 16% 10px;
+       width: 456px;
+}
+
+#t3-copyright-notice {
+       color: #797878;
+       margin-top: 15px;
+}
+
+#t3-copyright-notice a {
+       color: #797878;
+       text-decoration: underline;
+}
+
+#t3-copyright-notice a:hover {
+       color: #b0b0b0;
+}
+
+.shadow-box-top-428 {
+       background-image: url("../../images/shadows/box-top-428.png");
+       background-position: center bottom;
+       background-repeat: no-repeat;
+       height: 4px;
+}
+
+.shadow-box-bottom-424 {
+       background-image: url("../../images/shadows/box-bottom-424.png");
+       background-position: center top;
+       background-repeat: no-repeat;
+       height: 3px;
+}
diff --git a/typo3/sysext/t3skin/templates/errorpage-message.html b/typo3/sysext/t3skin/templates/errorpage-message.html
new file mode 100644 (file)
index 0000000..7973906
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?xml-stylesheet href="#internalStyle" type="text/css"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+       <meta name="robots" content="noindex, follow" />
+
+       <title>TYPO3 Error</title>
+
+       <base href="###BASEURL###" />
+
+       <link rel="stylesheet" href="###TYPO3_mainDir###sysext/t3skin/stylesheets/standalone/errorpage-message.css" />
+</head>
+
+<body class="t3-message-page t3-errorpage-message">
+
+<div class="t3-message-page-container">
+       <div class="t3-message-page-logo">
+               <img src="###TYPO3_mainDir###sysext/t3skin/images/login/typo3logo-white-greyback.gif" alt="TYPO3 logo" />
+       </div>
+       <div class="shadow-box-top-428"></div>
+       <div class="t3-message-page-message typo3-message message-error">
+               <h1>###TITLE###</h1>
+               <p class="t3-error-text">###MESSAGE###</p>
+       </div>
+       <div class="shadow-box-bottom-424"></div>
+</div>
+
+<div id="t3-footer">
+       <div id="t3-copyright-notice">
+               TYPO3 is an open source content management system. To maintain the quality of the system and to improve it, please help us by donating.
+               TYPO3 CMS. Copyright © 1998-2010 Kasper Skårhøj. Extensions are copyright of their respective owners. Go to http://typo3.com/ for details.
+               TYPO3 comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Obstructing the appearance of this notice is prohibited by law.
+       </div>
+</div>
+
+</body>
+</html>