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