[TASK] Replace sprite icon "actions-document-history-open" with the new IconFactory
[Packages/TYPO3.CMS.git] / typo3 / sysext / belog / Classes / ViewHelpers / HistoryEntryViewHelper.php
index d643d77..1edb0aa 100644 (file)
@@ -18,6 +18,8 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Belog\Domain\Model\HistoryEntry;
 use TYPO3\CMS\Belog\Domain\Repository\HistoryEntryRepository;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
@@ -63,6 +65,8 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt
                $historyEntry = $historyEntryRepository->findOneBySysLogUid($arguments['uid']);
                /** @var \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext */
                $controllerContext = $renderingContext->getControllerContext();
+               /** @var IconFactory $iconFactory */
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
 
                if (!$historyEntry instanceof HistoryEntry) {
                        return '';
@@ -72,9 +76,11 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt
                        $controllerContext->getRequest()->getControllerExtensionName(),
                        array($historyEntry->getFieldlist())
                );
-               $historyIcon = IconUtility::getSpriteIcon('actions-document-history-open', array(
-                       'title' => LocalizationUtility::translate('showHistory', $controllerContext->getRequest()->getControllerExtensionName())
-               ));
+               $titleLable = LocalizationUtility::translate(
+                       'showHistory',
+                       $controllerContext->getRequest()->getControllerExtensionName()
+               );
+               $historyIcon = $iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL);
                $historyHref = BackendUtility::getModuleUrl(
                                'record_history',
                                array(
@@ -82,7 +88,7 @@ class HistoryEntryViewHelper extends AbstractViewHelper implements CompilableInt
                                        'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI'),
                                )
                        );
-               $historyLink = '<a href="' . htmlspecialchars($historyHref) . '">' . $historyIcon . '</a>';
+               $historyLink = '<a href="' . htmlspecialchars($historyHref) . '" title="' . htmlspecialchars($titleLable) . '">' . $historyIcon . '</a>';
                return $historyLabel . '&nbsp;' . $historyLink;
        }