From f817b8ae010ce4175443b4cf28adad67c7cfc853 Mon Sep 17 00:00:00 2001
From: Markus Guenther <mail@markus-guenther.de>
Date: Fri, 7 Aug 2015 12:04:55 +0200
Subject: [PATCH] [TASK] Replace sprite icon "actions-document-import-t3d" with
 the new 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-document-import-t3d with the new IconFactory.

Change-Id: I4a4dd892ef867b8b900ee35290fa0e682480b70d
Resolves: #68827
Releases: master
Reviewed-on: http://review.typo3.org/42357
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
---
 typo3/sysext/impexp/Classes/Clickmenu.php     | 17 ++++++++++++++++-
 .../Classes/Browser/ElementBrowser.php        | 19 +++++++++++++++++--
 2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/typo3/sysext/impexp/Classes/Clickmenu.php b/typo3/sysext/impexp/Classes/Clickmenu.php
index 8b1becc0adc0..7d77627a4966 100644
--- a/typo3/sysext/impexp/Classes/Clickmenu.php
+++ b/typo3/sysext/impexp/Classes/Clickmenu.php
@@ -14,10 +14,25 @@ namespace TYPO3\CMS\Impexp;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * Adding Import/Export clickmenu item
  */
 class Clickmenu {
+	/**
+	 * @var IconFactory
+	 */
+	protected $iconFactory;
+
+	/**
+	 * Construct
+	 */
+	public function __construct() {
+		$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+	}
 
 	/**
 	 * Processing of clickmenu items
@@ -59,7 +74,7 @@ class Clickmenu {
 					),
 				);
 				$url = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('xMOD_tximpexp', $urlParameters);
-				$localItems[] = $backRef->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('import', $LL)), $backRef->excludeIcon(\TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-import-t3d')), $backRef->urlRefForCM($url), 1);
+				$localItems[] = $backRef->linkItem($GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLLL('import', $LL)), $backRef->excludeIcon($this->iconFactory->getIcon('actions-document-import-t3d', Icon::SIZE_SMALL)), $backRef->urlRefForCM($url), 1);
 			}
 		}
 		return array_merge($menuItems, $localItems);
diff --git a/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php b/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php
index 865ab5468d73..84a6805167cb 100755
--- a/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php
+++ b/typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php
@@ -24,6 +24,8 @@ use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\ElementBrowser\ElementBrowserHookInterface;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Resource\Exception;
@@ -254,6 +256,18 @@ class ElementBrowser {
 	 */
 	protected $pageRenderer = NULL;
 
+	/**
+	 * @var IconFactory
+	 */
+	protected $iconFactory;
+
+	/**
+	* Construct
+	*/
+	public function __construct() {
+		$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+	}
+
 	/**
 	 * Sets the script url depending on being a module or script request
 	 */
@@ -2520,8 +2534,9 @@ class ElementBrowser {
 		$labelImportSelection = $lang->sL('LLL:EXT:lang/locallang_browse_links.xlf:importSelection', TRUE);
 		// Getting flag for showing/not showing thumbnails:
 		$noThumbsInEB = $this->getBackendUser()->getTSConfigVal('options.noThumbsInEB');
-		$out = $this->doc->spacer(10) . '<div>' . '<a href="#" onclick="BrowseLinks.Selector.handle()">'
-			. IconUtility::getSpriteIcon('actions-document-import-t3d', array('title' => $labelImportSelection))
+		$out = $this->doc->spacer(10) . '<div>' . '<a href="#" onclick="BrowseLinks.Selector.handle()"'
+			. 'title="' . $labelImportSelection . '">'
+			. $this->iconFactory->getIcon('actions-document-import-t3d', Icon::SIZE_SMALL)
 			. $labelImportSelection . '</a>&nbsp;&nbsp;&nbsp;'
 			. '<a href="#" onclick="BrowseLinks.Selector.toggle()">'
 			. IconUtility::getSpriteIcon('actions-document-select', array('title' => $labelToggleSelection))
-- 
GitLab