17 use Psr\Http\Message\ServerRequestInterface;
52 public function getReport(ServerRequestInterface $request =
null)
58 $registry = GeneralUtility::makeInstance(Registry::class);
59 $registry->set(
'tx_reports',
'status.highestSeverity', $highestSeverity);
69 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'reports'][
'tx_reports'][
'status'][
'providers'] as $key => $statusProvidersList) {
70 $this->statusProviders[$key] = [];
71 foreach ($statusProvidersList as $statusProvider) {
72 $statusProviderInstance = GeneralUtility::makeInstance($statusProvider);
74 $this->statusProviders[$key][] = $statusProviderInstance;
89 foreach ($this->statusProviders as $statusProviderId => $statusProviderList) {
90 $status[$statusProviderId] = [];
91 foreach ($statusProviderList as $statusProvider) {
93 $statuses = $statusProvider->getStatus($request);
95 $statuses = $statusProvider->getStatus();
97 $status[$statusProviderId] = array_merge($status[$statusProviderId], $statuses);
111 foreach ($this->statusProviders as $statusProviderId => $statusProviderList) {
112 $status[$statusProviderId] = [];
113 foreach ($statusProviderList as $statusProvider) {
115 $statuses = $statusProvider->getDetailedStatus();
116 $status[$statusProviderId] = array_merge($status[$statusProviderId], $statuses);
131 $highestSeverity = ReportStatus::NOTICE;
132 foreach ($statusCollection as $statusProvider => $providerStatuses) {
134 foreach ($providerStatuses as $status) {
135 if ($status->getSeverity() > $highestSeverity) {
136 $highestSeverity = $status->getSeverity();
139 if ($highestSeverity == ReportStatus::ERROR) {
144 return $highestSeverity;
158 <td class="###CLASS### col-xs-6">###HEADER###</td>
159 <td class="###CLASS### col-xs-6">###STATUS###<br>###CONTENT###</td>
164 foreach ($statuses as $provider => $providerStatus) {
168 ReportStatus::NOTICE =>
'notice',
169 ReportStatus::INFO =>
'info',
170 ReportStatus::OK =>
'success',
171 ReportStatus::WARNING =>
'warning',
172 ReportStatus::ERROR =>
'danger'
176 foreach ($providerState as $status) {
177 $severity = $status->getSeverity();
178 $messages .= strtr($template, [
179 '###CLASS###' => $classes[$severity],
180 '###HEADER###' => $status->getTitle(),
181 '###STATUS###' => $status->getValue(),
182 '###CONTENT###' => $status->getMessage()
185 $header =
'<h2>' . $provider .
'</h2>';
186 $table =
'<table class="table table-striped table-hover">';
187 $table .=
'<tbody>' . $messages .
'</tbody>';
188 $table .=
'</table>';
190 $content .= $header . $table;
212 unset($statusCollection[
'typo3'], $statusCollection[
'system'], $statusCollection[
'security'], $statusCollection[
'configuration']);
216 $secondaryStatuses = [];
217 foreach ($statusCollection as $statusProviderId => $collection) {
219 if (strpos($statusProviderId,
'LLL:') === 0) {
226 $providerLabel = empty($label) ? $statusProviderId : $label;
227 $secondaryStatuses[$providerLabel] = $collection;
230 ksort($secondaryStatuses);
231 $orderedStatusCollection = array_merge($primaryStatuses, $secondaryStatuses);
232 return $orderedStatusCollection;
247 foreach ($statusCollection as $status) {
248 if ($status->getTitle() ===
'TYPO3') {
252 $statuses[] = $status;
253 $sortTitle[] = $status->getSeverity();
255 array_multisort($sortTitle, SORT_DESC, $statuses);
257 if (is_object($header)) {
258 array_unshift($statuses, $header);