TYPO3 CMS  TYPO3_8-7
WarningMessagePostProcessor.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
21 
26 {
35  public function displayWarningMessages_postProcess(array &$warningMessages)
36  {
37  if (!$this->getBackendUser()->isAdmin()) {
38  return;
39  }
40  // Get highest severity
42  $registry = GeneralUtility::makeInstance(Registry::class);
43  $highestSeverity = $registry->get('tx_reports', 'status.highestSeverity', null);
44  if (!is_null($highestSeverity)) {
45  if ($highestSeverity > ReportStatus::OK) {
46  // Display a message that there's something wrong and that
47  // the admin should take a look at the detailed status report
48  $this->getLanguageService()->includeLLFile('EXT:reports/Resources/Private/Language/locallang_reports.xlf');
49  $reportModuleIdentifier = 'system_ReportsTxreportsm1';
50  $reportModuleParameters = [
51  'tx_reports_system_reportstxreportsm1[extension]=tx_reports',
52  'tx_reports_system_reportstxreportsm1[report]=status',
53  'tx_reports_system_reportstxreportsm1[action]=detail',
54  'tx_reports_system_reportstxreportsm1[controller]=Report',
55  ];
56  $warningMessages['tx_reports_status_notification'] = sprintf(
57  $this->getLanguageService()->getLL('status_problemNotification'),
58  '<a href="javascript:top.goToModule(' . GeneralUtility::quoteJSvalue($reportModuleIdentifier) . ', 1, ' . GeneralUtility::quoteJSvalue('&' . implode('&', $reportModuleParameters)) . ');">',
59  '</a>'
60  );
61  }
62  }
63  }
64 
68  protected function getLanguageService()
69  {
70  return $GLOBALS['LANG'];
71  }
72 
76  protected function getBackendUser()
77  {
78  return $GLOBALS['BE_USER'];
79  }
80 }
getBackendUser()
static makeInstance($className,... $constructorArguments)
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']
getLanguageService()