Feature #12491: Reports: Allow multiple providers for each status collection
authorFrancois Suter <francois.suter@typo3.org>
Wed, 25 Nov 2009 09:41:33 +0000 (09:41 +0000)
committerFrancois Suter <francois.suter@typo3.org>
Wed, 25 Nov 2009 09:41:33 +0000 (09:41 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6522 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/install/ext_tables.php
typo3/sysext/install/report/class.tx_install_report_installstatus.php
typo3/sysext/reports/ext_autoload.php
typo3/sysext/reports/ext_tables.php
typo3/sysext/reports/reports/class.tx_reports_reports_status.php
typo3/sysext/reports/reports/status/class.tx_reports_reports_status_typo3status.php [new file with mode: 0644]

index be92e69..644cacb 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2009-11-24  Francois Suter  <francois@typo3.org>
 
        * Fixed bug #12547: Removed wrong default binary search paths for Windows
+       * Feature #12491: Reports: Allow multiple providers for each status collection
 
 2009-11-25  Oliver Hader  <oliver@typo3.org>
 
index 64412a2..2d0250a 100755 (executable)
@@ -4,7 +4,7 @@ if (!defined ('TYPO3_MODE'))    die ('Access denied.');
 if (TYPO3_MODE=='BE') {
        t3lib_extMgm::addModule('tools', 'install', '', t3lib_extMgm::extPath($_EXTKEY) . 'mod/');
 
-       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['typo3'] = 'tx_install_report_InstallStatus';
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['typo3'][] = 'tx_install_report_InstallStatus';
 }
 
 ?>
\ No newline at end of file
index f363d57..f4798d0 100644 (file)
@@ -35,7 +35,7 @@ require_once(t3lib_extMgm::extPath('install', 'requirements.php'));
  */
 class tx_install_report_InstallStatus implements tx_reports_StatusProvider {
 
-       protected $reportList = 'Typo3Version,FileSystem,RemainingUpdates';
+       protected $reportList = 'FileSystem,RemainingUpdates';
 
        /**
         * Compiles a collection of system status checks as a status report.
@@ -54,20 +54,6 @@ class tx_install_report_InstallStatus implements tx_reports_StatusProvider {
        }
 
        /**
-        * Simply gets the current TYPO3 version.
-        *
-        * @return      tx_reports_reports_status_Status
-        */
-       protected function getTypo3VersionStatus() {
-               return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'TYPO3',
-                       TYPO3_version,
-                       '',
-                       tx_reports_reports_status_Status::NOTICE
-               );
-       }
-
-       /**
         * Checks for several directoris being writable.
         *
         * @return unknown_type
index 0d6e0d5..b4bf63b 100644 (file)
@@ -10,6 +10,7 @@ return array(
        'tx_reports_report' => $extensionPath . 'interfaces/interface.tx_reports_report.php',
        'tx_reports_module' => $extensionPath . 'mod/index.php',
        'tx_reports_reports_status' => $extensionPath . 'reports/class.tx_reports_reports_status.php',
+       'tx_reports_reports_status_typo3status' => $extensionPath . 'reports/status/class.tx_reports_reports_status_typo3status.php',
        'tx_reports_reports_status_systemstatus' => $extensionPath . 'reports/status/class.tx_reports_reports_status_systemstatus.php',
        'tx_reports_reports_status_securitystatus' => $extensionPath . 'reports/status/class.tx_reports_reports_status_securitystatus.php',
        'tx_reports_reports_status_configurationstatus' => $extensionPath . 'reports/status/class.tx_reports_reports_status_configurationstatus.php',
index 3b114e9..31e0b0d 100644 (file)
@@ -18,9 +18,10 @@ if (TYPO3_MODE == 'BE') {
                $statusReport
        );
 
-       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['system'] = 'tx_reports_reports_status_SystemStatus';
-       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['security'] = 'tx_reports_reports_status_SecurityStatus';
-       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['configuration'] = 'tx_reports_reports_status_ConfigurationStatus';
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['typo3'][] = 'tx_reports_reports_status_Typo3Status';
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['system'][] = 'tx_reports_reports_status_SystemStatus';
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['security'][] = 'tx_reports_reports_status_SecurityStatus';
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['configuration'][] = 'tx_reports_reports_status_ConfigurationStatus';
 
        $GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']['Reports::saveCollapseState'] = 'EXT:reports/reports/class.tx_reports_reports_status.php:tx_reports_reports_Status->saveCollapseState';
 }
index 1f8abbc..300fa1c 100644 (file)
@@ -52,8 +52,12 @@ class tx_reports_reports_Status implements tx_reports_Report {
                $status  = array();
                $content = '';
 
-               foreach ($this->statusProviders as $statusProviderId => $statusProvider) {
-                       $status[$statusProviderId] = $statusProvider->getStatus();
+               foreach ($this->statusProviders as $statusProviderId => $statusProvidersList) {
+                       $status[$statusProviderId] = array();
+                       foreach ($statusProvidersList as $statusProvider) {
+                               $statuses = $statusProvider->getStatus();
+                               $status[$statusProviderId] = array_merge($status[$statusProviderId], $statuses);
+                       }
                }
 
                $content .= '<p class="help">'
@@ -69,10 +73,13 @@ class tx_reports_reports_Status implements tx_reports_Report {
         * @return      void
         */
        protected function getStatusProviders() {
-               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers'] as $key => $statusProvider) {
-                       $statusProviderInstance = t3lib_div::makeInstance($statusProvider);
-                       if ($statusProviderInstance instanceof tx_reports_StatusProvider) {
-                               $this->statusProviders[$key] = $statusProviderInstance;
+               foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers'] as $key => $statusProvidersList) {
+                       $this->statusProviders[$key] = array();
+                       foreach ($statusProvidersList as $statusProvider) {
+                               $statusProviderInstance = t3lib_div::makeInstance($statusProvider);
+                               if ($statusProviderInstance instanceof tx_reports_StatusProvider) {
+                                       $this->statusProviders[$key][] = $statusProviderInstance;
+                               }
                        }
                }
        }
diff --git a/typo3/sysext/reports/reports/status/class.tx_reports_reports_status_typo3status.php b/typo3/sysext/reports/reports/status/class.tx_reports_reports_status_typo3status.php
new file mode 100644 (file)
index 0000000..bdc8d67
--- /dev/null
@@ -0,0 +1,70 @@
+<?php\r
+/***************************************************************\r
+*  Copyright notice\r
+*\r
+*  (c) 2009 Ingo Renner <ingo@typo3.org>\r
+*  All rights reserved\r
+*\r
+*  This script is part of the TYPO3 project. The TYPO3 project is\r
+*  free software; you can redistribute it and/or modify\r
+*  it under the terms of the GNU General Public License as published by\r
+*  the Free Software Foundation; either version 2 of the License, or\r
+*  (at your option) any later version.\r
+*\r
+*  The GNU General Public License can be found at\r
+*  http://www.gnu.org/copyleft/gpl.html.\r
+*\r
+*  This script is distributed in the hope that it will be useful,\r
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+*  GNU General Public License for more details.\r
+*\r
+*  This copyright notice MUST APPEAR in all copies of the script!\r
+***************************************************************/\r
+\r
+\r
+/**\r
+ * Performs basic checks about the TYPO3 install\r
+ *\r
+ * @author             Ingo Renner <ingo@typo3.org>\r
+ * @package            TYPO3\r
+ * @subpackage reports\r
+ */\r
+class tx_reports_reports_status_Typo3Status implements tx_reports_StatusProvider {\r
+\r
+       /**\r
+        * Returns the status for this report\r
+        *\r
+        * @see typo3/sysext/reports/interfaces/tx_reports_StatusProvider::getStatus()\r
+        */\r
+       public function getStatus() {\r
+               $statuses = array(\r
+                       'Typo3Version' => $this->getTypo3VersionStatus(),\r
+\r
+               );\r
+\r
+               return $statuses;\r
+       }\r
+\r
+       /**\r
+        * Simply gets the current TYPO3 version.\r
+        *\r
+        * @return      tx_reports_reports_status_Status\r
+        */\r
+       protected function getTypo3VersionStatus() {\r
+               return t3lib_div::makeInstance('tx_reports_reports_status_Status',\r
+                       'TYPO3',\r
+                       TYPO3_version,\r
+                       '',\r
+                       tx_reports_reports_status_Status::NOTICE\r
+               );\r
+       }\r
+\r
+}\r
+\r
+\r
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_typo3status.php'])     {\r
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_typo3status.php']);\r
+}\r
+\r
+?>
\ No newline at end of file