33 $GLOBALS[
'LANG']->includeLLFile(
'EXT:reports/reports/locallang.xlf');
44 $highestSeverity = $this->getHighestSeverity($status);
47 $registry->set(
'tx_reports',
'status.highestSeverity', $highestSeverity);
48 $content .=
'<p class="lead">' .
$GLOBALS[
'LANG']->getLL(
'status_report_explanation') .
'</p>';
49 return $content . $this->renderStatus($status);
58 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'reports'][
'tx_reports'][
'status'][
'providers'] as $key => $statusProvidersList) {
59 $this->statusProviders[$key] = array();
60 foreach ($statusProvidersList as $statusProvider) {
63 $this->statusProviders[$key][] = $statusProviderInstance;
76 foreach ($this->statusProviders as $statusProviderId => $statusProviderList) {
77 $status[$statusProviderId] = array();
78 foreach ($statusProviderList as $statusProvider) {
79 $statuses = $statusProvider->getStatus();
80 $status[$statusProviderId] = array_merge($status[$statusProviderId], $statuses);
92 public function getHighestSeverity(array $statusCollection) {
94 foreach ($statusCollection as $statusProvider => $providerStatuses) {
96 foreach ($providerStatuses as $status) {
97 if ($status->getSeverity() > $highestSeverity) {
98 $highestSeverity = $status->getSeverity();
106 return $highestSeverity;
115 protected function renderStatus(array $statusCollection) {
119 <div class="typo3-message message-###CLASS###"> 120 <div class="header-container"> 121 <div class="message-header message-left">###HEADER###</div> 122 <div class="message-header message-right">###STATUS###</div> 124 <div class="message-body">###CONTENT###</div> 127 foreach ($statuses as $provider => $providerStatus) {
128 $providerState = $this->sortStatuses($providerStatus);
129 $id = str_replace(
' ',
'-', $provider);
141 $sectionSeverity = 0;
143 foreach ($providerState as $status) {
144 $severity = $status->getSeverity();
145 $sectionSeverity = $severity > $sectionSeverity ? $severity : $sectionSeverity;
146 $messages .= strtr($template, array(
147 '###CLASS###' => $classes[$severity],
148 '###HEADER###' => $status->getTitle(),
149 '###STATUS###' => $status->getValue(),
150 '###CONTENT###' => $status->getMessage()
153 if ($sectionSeverity > 0) {
154 $headerIcon = $icon[$sectionSeverity];
156 $content .=
$GLOBALS[
'TBE_TEMPLATE']->collapseableSection($headerIcon . $provider, $messages, $id,
'reports.states');
171 $primaryStatuses = array(
172 $GLOBALS[
'LANG']->getLL(
'status_typo3') => $statusCollection[
'typo3'],
173 $GLOBALS[
'LANG']->getLL(
'status_system') => $statusCollection[
'system'],
174 $GLOBALS[
'LANG']->getLL(
'status_security') => $statusCollection[
'security'],
175 $GLOBALS[
'LANG']->getLL(
'status_configuration') => $statusCollection[
'configuration']
177 unset($statusCollection[
'typo3'], $statusCollection[
'system'], $statusCollection[
'security'], $statusCollection[
'configuration']);
181 $secondaryStatuses = array();
182 foreach ($statusCollection as $statusProviderId => $collection) {
184 if (strpos($statusProviderId,
'LLL:') === 0) {
186 $label =
$GLOBALS[
'LANG']->sL($statusProviderId);
189 $label =
$GLOBALS[
'LANG']->getLL(
'status_' . $statusProviderId);
191 $providerLabel = empty($label) ? $statusProviderId : $label;
192 $secondaryStatuses[$providerLabel] = $collection;
195 ksort($secondaryStatuses);
196 $orderedStatusCollection = array_merge($primaryStatuses, $secondaryStatuses);
197 return $orderedStatusCollection;
206 protected function sortStatuses(array $statusCollection) {
208 $sortTitle = array();
210 foreach ($statusCollection as $status) {
211 if ($status->getTitle() ===
'TYPO3') {
215 $statuses[] = $status;
216 $sortTitle[] = $status->getSeverity();
218 array_multisort($sortTitle, SORT_DESC, $statuses);
220 if (is_object($header)) {
221 array_unshift($statuses, $header);
sortStatusProviders(array $statusCollection)
static makeInstance($className)
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]