‪TYPO3CMS  ‪main
Typo3Status.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
24 
29 {
35  public function ‪getStatus(): array
36  {
37  $statuses = [
38  'registeredXclass' => $this->‪getRegisteredXclassStatus(),
39  ];
40  return $statuses;
41  }
42 
43  public function ‪getLabel(): string
44  {
45  return 'typo3';
46  }
47 
53  protected function ‪getRegisteredXclassStatus()
54  {
55  $message = '';
56  $value = $this->‪getLanguageService()->sL('LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_none');
57  $severity = ContextualFeedbackSeverity::OK;
58 
59  $xclassFoundArray = [];
60  if (array_key_exists('Objects', ‪$GLOBALS['TYPO3_CONF_VARS']['SYS'])) {
61  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'] as $originalClass => $override) {
62  if (array_key_exists('className', $override)) {
63  $xclassFoundArray[$originalClass] = $override['className'];
64  }
65  }
66  }
67  if (!empty($xclassFoundArray)) {
68  $value = $this->‪getLanguageService()->sL('LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_xclassUsageFound');
69  $message = $this->‪getLanguageService()->sL('LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_xclassUsageFound_message') . '<br />';
70  $message .= '<ol>';
71  foreach ($xclassFoundArray as $originalClass => $xClassName) {
72  $messageDetail = sprintf(
73  (string)($this->‪getLanguageService()->sL('LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_xclassUsageFound_message_detail')),
74  '<code>' . htmlspecialchars((string)$originalClass) . '</code>',
75  '<code>' . htmlspecialchars((string)$xClassName) . '</code>'
76  );
77  $message .= '<li>' . $messageDetail . '</li>';
78  }
79  $message .= '</ol>';
80  $severity = ContextualFeedbackSeverity::NOTICE;
81  }
82 
83  return GeneralUtility::makeInstance(
84  ReportStatus::class,
85  $this->‪getLanguageService()->sL('LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_xclassUsage'),
86  $value,
87  $message,
88  $severity
89  );
90  }
91 
93  {
94  return ‪$GLOBALS['LANG'];
95  }
96 }
‪TYPO3\CMS\Reports\StatusProviderInterface
Definition: StatusProviderInterface.php:22
‪TYPO3\CMS\Reports\Report\Status\Typo3Status\getLanguageService
‪getLanguageService()
Definition: Typo3Status.php:92
‪TYPO3\CMS\Reports\Report\Status\Status
Definition: Status.php:34
‪TYPO3\CMS\Reports\Report\Status\Typo3Status\getStatus
‪Status[] getStatus()
Definition: Typo3Status.php:35
‪TYPO3\CMS\Core\Type\ContextualFeedbackSeverity
‪ContextualFeedbackSeverity
Definition: ContextualFeedbackSeverity.php:25
‪TYPO3\CMS\Core\Security\ContentSecurityPolicy\Reporting\ReportStatus
‪ReportStatus
Definition: ReportStatus.php:24
‪TYPO3\CMS\Reports\Status
Definition: Status.php:24
‪TYPO3\CMS\Reports\Report\Status\Typo3Status
Definition: Typo3Status.php:29
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Reports\Report\Status\Typo3Status\getLabel
‪getLabel()
Definition: Typo3Status.php:43
‪TYPO3\CMS\Reports\Report\Status
Definition: ConfigurationStatus.php:16
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:46
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Reports\Report\Status\Typo3Status\getRegisteredXclassStatus
‪TYPO3 CMS Reports Status getRegisteredXclassStatus()
Definition: Typo3Status.php:53