‪TYPO3CMS  10.4
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 
20 use ‪TYPO3\CMS\Reports\Status as ReportStatus;
22 
27 {
33  public function ‪getStatus()
34  {
35  $statuses = [
36  'registeredXclass' => $this->‪getRegisteredXclassStatus(),
37  ];
38  return $statuses;
39  }
40 
46  protected function ‪getRegisteredXclassStatus()
47  {
48  $message = '';
49  $value = $this->‪getLanguageService()->‪getLL('status_none');
50  $severity = ReportStatus::OK;
51 
52  $xclassFoundArray = [];
53  if (array_key_exists('Objects', ‪$GLOBALS['TYPO3_CONF_VARS']['SYS'])) {
54  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'] as $originalClass => $override) {
55  if (array_key_exists('className', $override)) {
56  $xclassFoundArray[$originalClass] = $override['className'];
57  }
58  }
59  }
60  if (!empty($xclassFoundArray)) {
61  $value = $this->‪getLanguageService()->‪getLL('status_xclassUsageFound');
62  $message = $this->‪getLanguageService()->‪getLL('status_xclassUsageFound_message') . '<br />';
63  $message .= '<ol>';
64  foreach ($xclassFoundArray as $originalClass => $xClassName) {
65  $messageDetail = sprintf(
66  $this->‪getLanguageService()->getLL('status_xclassUsageFound_message_detail'),
67  '<code>' . htmlspecialchars((string)$originalClass) . '</code>',
68  '<code>' . htmlspecialchars($xClassName) . '</code>'
69  );
70  $message .= '<li>' . $messageDetail . '</li>';
71  }
72  $message .= '</ol>';
73  $severity = ReportStatus::NOTICE;
74  }
75 
76  return GeneralUtility::makeInstance(
77  ReportStatus::class,
78  $this->‪getLanguageService()->getLL('status_xclassUsage'),
79  $value,
80  $message,
81  $severity
82  );
83  }
84 
88  protected function ‪getLanguageService()
89  {
90  return ‪$GLOBALS['LANG'];
91  }
92 }
‪TYPO3\CMS\Reports\StatusProviderInterface
Definition: StatusProviderInterface.php:22
‪TYPO3\CMS\Reports\Report\Status\Typo3Status\getStatus
‪array getStatus()
Definition: Typo3Status.php:33
‪TYPO3\CMS\Reports\Status
Definition: Status.php:24
‪TYPO3\CMS\Reports\Report\Status\Typo3Status
Definition: Typo3Status.php:27
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Reports\Report\Status
Definition: ConfigurationStatus.php:16
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42
‪TYPO3\CMS\Core\Localization\LanguageService\getLL
‪string getLL($index)
Definition: LanguageService.php:154
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Reports\Report\Status\Typo3Status\getLanguageService
‪LanguageService getLanguageService()
Definition: Typo3Status.php:88
‪TYPO3\CMS\Reports\Report\Status\Typo3Status\getRegisteredXclassStatus
‪TYPO3 CMS Reports Status getRegisteredXclassStatus()
Definition: Typo3Status.php:46