TYPO3 CMS  TYPO3_8-7
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  */
21 
26 {
32  public function getStatus()
33  {
34  $statuses = [
35  'registeredXclass' => $this->getRegisteredXclassStatus(),
36  'compatibility7' => $this->getCompatibility7Status(),
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($originalClass) . '</code>',
68  '<code>' . htmlspecialchars($xClassName) . '</code>'
69  );
70  $message .= '<li>' . $messageDetail . '</li>';
71  }
72  $message .= '</ol>';
73  $severity = ReportStatus::NOTICE;
74  }
75 
77  ReportStatus::class,
78  $this->getLanguageService()->getLL('status_xclassUsage'),
79  $value,
80  $message,
81  $severity
82  );
83  }
84 
90  protected function getCompatibility7Status()
91  {
92  $message = '';
93  $value = $this->getLanguageService()->getLL('status_disabled');
94  $severity = ReportStatus::OK;
95 
96  if (ExtensionManagementUtility::isLoaded('compatibility7')) {
97  $value = $this->getLanguageService()->getLL('status_enabled');
98  $message = $this->getLanguageService()->getLL('status_compatibility7Usage_message');
99  $severity = ReportStatus::WARNING;
100  }
101 
103  ReportStatus::class,
104  $this->getLanguageService()->getLL('status_compatibility7Usage'),
105  $value,
106  $message,
107  $severity
108  );
109  }
110 
114  protected function getLanguageService()
115  {
116  return $GLOBALS['LANG'];
117  }
118 }
static makeInstance($className,... $constructorArguments)
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']