Follow-up to #12089: Make messages in reports module collapsible: add error/warning...
authorSteffen Kamper <info@sk-typo3.de>
Thu, 1 Oct 2009 10:36:30 +0000 (10:36 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 1 Oct 2009 10:36:30 +0000 (10:36 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6086 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/reports/mod/mod_styles.css
typo3/sysext/reports/reports/class.tx_reports_reports_status.php

index 57cbc64..3c7e7a2 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-10-01  Steffen Kamper  <info@sk-typo3.de>
 
+       * Follow-up to #12089: Make messages in reports module collapsible: add error/warning icon to header
        * Follow-up to #11843 Add a reports module: endPage was applied twice
 
 2009-10-01  Oliver Hader  <oliver@typo3.org>
index 51065c8..7e76492 100644 (file)
@@ -31,6 +31,8 @@ body#ext-reports-mod-index-php {
        margin: 15px 0;
        padding: 2px 0 0 20px;
        cursor: pointer;
+       height: 20px;
+       clear: left;
 }
 #ext-reports-mod-index-php h2.collapsed {
        background-image:url(../../../gfx/arrowright.png);
@@ -40,6 +42,10 @@ body#ext-reports-mod-index-php {
        background-image:url(../../../gfx/arrowdown.png);
        background-repeat:no-repeat;
 }
+#ext-reports-mod-index-php h2.section-header img {
+       margin-right:2px;
+       vertical-align:bottom;
+}
 
 #ext-reports-mod-index-php .message-body {
        clear: left;
index 988670a..4268e4f 100644 (file)
@@ -119,8 +119,7 @@ class tx_reports_reports_Status implements tx_reports_Report {
                                $collapsedClass = 'expanded';
                        }
 
-                       $content .= '<h2 id="' . $id . '" class="section-header ' . $collapsedClass . '">' . $provider . '</h2>
-                               <div ' . $collapsedStyle . '>';
+                       
                        $classes = array(
                                tx_reports_reports_status_Status::NOTICE  => 'notice',
                                tx_reports_reports_status_Status::INFO    => 'information',
@@ -129,15 +128,27 @@ class tx_reports_reports_Status implements tx_reports_Report {
                                tx_reports_reports_status_Status::ERROR   => 'error',
                        );
 
+                       $icon[tx_reports_reports_status_Status::WARNING] = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/warning.png', 'width="16" height="16"') . ' />';
+                       $icon[tx_reports_reports_status_Status::ERROR] = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/error.png', 'width="16" height="16"') . ' />';
+                       $messages = '';
+                       $headerIcon = '';
+                       $sectionSeverity = 0;
+
                        foreach ($providerState as $status) {
-                               $content .= strtr($template, array(
-                                       '###CLASS###'   => $classes[$status->getSeverity()],
+                               $severity = $status->getSeverity();
+                               $sectionSeverity = $severity > $sectionSeverity ? $severity : $sectionSeverity;
+                               $messages .= strtr($template, array(
+                                       '###CLASS###'   => $classes[$severity],
                                        '###HEADER###'  => $status->getTitle(),
                                        '###STATUS###'  => $status->getValue(),
                                        '###CONTENT###' => $status->getMessage(),
                                ));
                        }
-                       $content .= '</div>';
+                       if ($sectionSeverity > 0) {
+                               $headerIcon = $icon[$sectionSeverity];
+                       }
+                       $content .= '<h2 id="' . $id . '" class="section-header ' . $collapsedClass . '">' . $headerIcon . $provider . '</h2>
+                               <div ' . $collapsedStyle . '>' . $messages . '</div>';
                }
                return $content;
        }