Cleanup: Updated copyright comments
[Packages/TYPO3.CMS.git] / typo3 / sysext / reports / reports / status / class.tx_reports_reports_status_warningmessagepostprocessor.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2010-2011 Ingo Renner <ingo@typo3.org>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25
26 /**
27 * Post processes the warning messages found in about modules.
28 *
29 * @author Ingo Renner <ingo@typo3.org>
30 * @package TYPO3
31 * @subpackage reports
32 */
33 class tx_reports_reports_status_WarningMessagePostProcessor {
34
35 /**
36 * Tries to get the highest severity of the system's status first, if
37 * something is found it is asumed that the status update task is set up
38 * properly or the status report has been checked manually and we take over
39 * control over the system warning messages.
40 *
41 * @param array An array of messages related to already found issues.
42 */
43 public function displayWarningMessages_postProcess(array &$warningMessages) {
44
45 // get highest severity
46 $registry = t3lib_div::makeInstance('t3lib_Registry');
47 $highestSeverity = $registry->get(
48 'tx_reports',
49 'status.highestSeverity',
50 NULL
51 );
52
53 if (!is_null($highestSeverity)) {
54 // status update has run, so taking over control over the core messages
55 unset(
56 $warningMessages['install_password'],
57 $warningMessages['backend_admin'],
58 $warningMessages['install_enabled'],
59 $warningMessages['install_encryption'],
60 $warningMessages['file_deny_pattern'],
61 $warningMessages['file_deny_htaccess'],
62 $warningMessages['install_update'],
63 $warningMessages['backend_reference'],
64 $warningMessages['memcached']
65 );
66
67 if ($highestSeverity > tx_reports_reports_status_Status::OK) {
68 // display a message that there's something wrong and that
69 // the admin should take a look at the detailed status report
70 $GLOBALS['LANG']->includeLLFile('EXT:reports/reports/locallang.xml');
71
72 $warningMessages['tx_reports_status_notification'] = sprintf(
73 $GLOBALS['LANG']->getLL('status_problemNotification'),
74 '<a href="javascript:top.goToModule(\'tools_txreportsM1\', 1, \'&SET[function]=tx_reports.status\');">',
75 '</a>'
76 );
77 }
78 }
79 }
80 }
81
82
83 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_warningmessagepostprocessor.php'])) {
84 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_warningmessagepostprocessor.php']);
85 }
86
87 ?>