minor code beautification
authorIngo Renner <ingo.renner@typo3.org>
Fri, 12 Nov 2010 22:54:02 +0000 (22:54 +0000)
committerIngo Renner <ingo.renner@typo3.org>
Fri, 12 Nov 2010 22:54:02 +0000 (22:54 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9357 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/sysext/reports/reports/class.tx_reports_reports_status.php

index a76587f..d0c7129 100644 (file)
@@ -166,14 +166,13 @@ class tx_reports_reports_Status implements tx_reports_Report {
 
                        $id = str_replace(' ', '-', $provider);
                        if (isset($GLOBALS['BE_USER']->uc['reports']['states'][$id]) && $GLOBALS['BE_USER']->uc['reports']['states'][$id]) {
 
                        $id = str_replace(' ', '-', $provider);
                        if (isset($GLOBALS['BE_USER']->uc['reports']['states'][$id]) && $GLOBALS['BE_USER']->uc['reports']['states'][$id]) {
-                               $collapsedStyle = 'style="display:none"';
+                               $collapsedStyle = 'style="display: none"';
                                $collapsedClass = 'collapsed';
                        } else {
                                $collapsedStyle = '';
                                $collapsedClass = 'expanded';
                        }
 
                                $collapsedClass = 'collapsed';
                        } else {
                                $collapsedStyle = '';
                                $collapsedClass = 'expanded';
                        }
 
-
                        $classes = array(
                                tx_reports_reports_status_Status::NOTICE  => 'notice',
                                tx_reports_reports_status_Status::INFO    => 'information',
                        $classes = array(
                                tx_reports_reports_status_Status::NOTICE  => 'notice',
                                tx_reports_reports_status_Status::INFO    => 'information',
@@ -183,9 +182,9 @@ class tx_reports_reports_Status implements tx_reports_Report {
                        );
 
                        $icon[tx_reports_reports_status_Status::WARNING] = t3lib_iconWorks::getSpriteIcon('status-dialog-warning');
                        );
 
                        $icon[tx_reports_reports_status_Status::WARNING] = t3lib_iconWorks::getSpriteIcon('status-dialog-warning');
-                       $icon[tx_reports_reports_status_Status::ERROR] = t3lib_iconWorks::getSpriteIcon('status-dialog-error');
-                       $messages = '';
-                       $headerIcon = '';
+                       $icon[tx_reports_reports_status_Status::ERROR]   = t3lib_iconWorks::getSpriteIcon('status-dialog-error');
+                       $messages        = '';
+                       $headerIcon      = '';
                        $sectionSeverity = 0;
 
                        foreach ($providerState as $status) {
                        $sectionSeverity = 0;
 
                        foreach ($providerState as $status) {
@@ -229,11 +228,14 @@ class tx_reports_reports_Status implements tx_reports_Report {
                        $statusCollection['security'],
                        $statusCollection['configuration']
                );
                        $statusCollection['security'],
                        $statusCollection['configuration']
                );
+
                        // Assemble list of secondary status collections with left-over collections
                        // Change their keys using localized labels if available
                        // Assemble list of secondary status collections with left-over collections
                        // Change their keys using localized labels if available
+                       // TODO extract into getLabel() method
                $secondaryStatuses = array();
                foreach ($statusCollection as $statusProviderId => $collection) {
                        $label = '';
                $secondaryStatuses = array();
                foreach ($statusCollection as $statusProviderId => $collection) {
                        $label = '';
+
                        if (strpos($statusProviderId, 'LLL:') === 0) {
                                        // Label provided by extension
                                $label = $GLOBALS['LANG']->sL($statusProviderId);
                        if (strpos($statusProviderId, 'LLL:') === 0) {
                                        // Label provided by extension
                                $label = $GLOBALS['LANG']->sL($statusProviderId);
@@ -241,6 +243,7 @@ class tx_reports_reports_Status implements tx_reports_Report {
                                        // Generic label
                                $label = $GLOBALS['LANG']->getLL('status_' . $statusProviderId);
                        }
                                        // Generic label
                                $label = $GLOBALS['LANG']->getLL('status_' . $statusProviderId);
                        }
+
                        $providerLabel = (empty($label)) ? $statusProviderId : $label;
                        $secondaryStatuses[$providerLabel] = $collection;
                }
                        $providerLabel = (empty($label)) ? $statusProviderId : $label;
                        $secondaryStatuses[$providerLabel] = $collection;
                }