diff --git a/typo3/sysext/belog/Classes/Domain/Model/LogEntry.php b/typo3/sysext/belog/Classes/Domain/Model/LogEntry.php index ab1ea1e2988f..a71818a278ba 100644 --- a/typo3/sysext/belog/Classes/Domain/Model/LogEntry.php +++ b/typo3/sysext/belog/Classes/Domain/Model/LogEntry.php @@ -278,6 +278,24 @@ public function getError() return (int)$this->error; } + /** + * Get class name for the error code + * + * @return string + */ + public function getErrorIconClass(): string + { + switch ($this->getError()) { + case 1: + return 'status-dialog-warning'; + case 2: + case 3: + return 'status-dialog-error'; + default: + return 'empty-empty'; + } + } + /** * Set details * diff --git a/typo3/sysext/belog/Classes/ViewHelpers/ErrorIconViewHelper.php b/typo3/sysext/belog/Classes/ViewHelpers/ErrorIconViewHelper.php deleted file mode 100644 index db58d08407f3..000000000000 --- a/typo3/sysext/belog/Classes/ViewHelpers/ErrorIconViewHelper.php +++ /dev/null @@ -1,72 +0,0 @@ -registerArgument('errorNumber', 'int', 'The error number (0 ... 3)', false, 0); - } - - /** - * Renders an error icon link as known from the TYPO3 backend. - * Error codes 2 and three are mapped to "error" and 1 is mapped to "warning". - * - * @param array $arguments - * @param \Closure $renderChildrenClosure - * @param RenderingContextInterface $renderingContext - * - * @return string - */ - public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) - { - $errorSymbols = [ - '0' => '', - '1' => 'status-dialog-warning', - '2' => 'status-dialog-error', - '3' => 'status-dialog-error' - ]; - if ($errorSymbols[$arguments['errorNumber']]) { - $iconFactory = GeneralUtility::makeInstance(IconFactory::class); - return $iconFactory->getIcon($errorSymbols[$arguments['errorNumber']], Icon::SIZE_SMALL)->render(); - } - return ''; - } -} diff --git a/typo3/sysext/belog/Resources/Private/Partials/Content/LogEntries.html b/typo3/sysext/belog/Resources/Private/Partials/Content/LogEntries.html index 5c832fc3bea6..d9b051fa0978 100644 --- a/typo3/sysext/belog/Resources/Private/Partials/Content/LogEntries.html +++ b/typo3/sysext/belog/Resources/Private/Partials/Content/LogEntries.html @@ -139,7 +139,9 @@

- + + + @{logItem.tstamp}