fixed a typo in a variable name
[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 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 * @return void
43 */
44 public function displayWarningMessages_postProcess(array &$warningMessages) {
45
46 // get highest severity
47 $registry = t3lib_div::makeInstance('t3lib_Registry');
48 $highestSeverity = $registry->get(
49 'tx_reports',
50 'status.highestSeverity',
51 null
52 );
53
54 if (!is_null($highestSeverity)) {
55 // status update has run, so taking over control over the core messages
56 unset(
57 $warningMessages['install_password'],
58 $warningMessages['backend_admin'],
59 $warningMessages['install_enabled'],
60 $warningMessages['install_encryption'],
61 $warningMessages['file_deny_pattern'],
62 $warningMessages['file_deny_htaccess'],
63 $warningMessages['install_update'],
64 $warningMessages['backend_reference'],
65 $warningMessages['memcached']
66 );
67
68 if ($highestSeverity > tx_reports_reports_status_Status::OK) {
69 // display a message that there's something wrong and that
70 // the admin should take a look at the detailed status report
71 $GLOBALS['LANG']->includeLLFile('EXT:reports/reports/locallang.xml');
72
73 $warningMessages['tx_reports_status_notification'] = sprintf(
74 $GLOBALS['LANG']->getLL('status_problemNotification'),
75 '<a href="mod.php?M=tools_txreportsM1&SET[function]=tx_reports.status">',
76 '</a>'
77 );
78 }
79 }
80 }
81 }
82
83
84 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_warningmessagepostprocessor.php']) {
85 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_warningmessagepostprocessor.php']);
86 }
87
88 ?>