From 854b563742ed4b0b4f3123c7efdcdb2e23ae0d96 Mon Sep 17 00:00:00 2001 From: Markus Guenther Date: Tue, 11 Aug 2015 10:29:55 +0200 Subject: [PATCH] [TASK] Replace sprite icon for visibility with IconFactory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces all IconUtility::getSpriteIcon calls for the icon actions-edit-hide and actions-edit-unhide with the new IconFactory. Change-Id: If3deb6fb4c6f867c21aaff34796515d933fa90c3 Resolves: #68925 Releases: master Reviewed-on: http://review.typo3.org/42499 Reviewed-by: Daniel Goerz Tested-by: Daniel Goerz Reviewed-by: Frank Nägler Tested-by: Frank Nägler --- Classes/FrontendEditPanel.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Classes/FrontendEditPanel.php b/Classes/FrontendEditPanel.php index 3ee431c..3f6b022 100644 --- a/Classes/FrontendEditPanel.php +++ b/Classes/FrontendEditPanel.php @@ -18,6 +18,7 @@ use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\IconUtility; use TYPO3\CMS\Backend\FrontendBackendUserAuthentication; use TYPO3\CMS\Core\Database\DatabaseConnection; +use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; @@ -55,6 +56,11 @@ class FrontendEditPanel { */ protected $backendUser; + /** + * @var \TYPO3\CMS\Core\Imaging\IconFactory + */ + protected $iconFactory; + /** * Constructor for the edit panel * @@ -68,6 +74,7 @@ class FrontendEditPanel { $this->backendUser = $backendUser ?: $GLOBALS['BE_USER']; $this->cObj = GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class); $this->cObj->start(array()); + $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class); } /** @@ -116,10 +123,10 @@ class FrontendEditPanel { // Hiding for localizations because it is unknown what should be the function in that case if (isset($allow['hide']) && $hideField && $this->backendUser->workspace === 0 && !$dataArr['_LOCALIZED_UID']) { if ($dataArr[$hideField]) { - $icon = IconUtility::getSpriteIcon('actions-edit-unhide', array('title' => $this->backendUser->extGetLL('p_unhide'))); + $icon = $this->iconFactory->getIcon('actions-edit-unhide'); $panel .= $this->editPanelLinkWrap($icon, $formName, 'unhide'); } else { - $icon = IconUtility::getSpriteIcon('actions-edit-hide', array('title' => $this->backendUser->extGetLL('p_hide'))); + $icon = $this->iconFactory->getIcon('actions-edit-hide'); $panel .= $this->editPanelLinkWrap($icon, $formName, 'hide', '', $this->backendUser->extGetLL('p_hideConfirm')); } }