[TASK] Replace sprite icons for history with IconFactory 35/42535/8
authorMarkus Guenther <mail@markus-guenther.de>
Wed, 12 Aug 2015 18:53:48 +0000 (20:53 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 16 Aug 2015 16:32:43 +0000 (18:32 +0200)
Replaces all IconUtility::getSpriteIcon calls for the icon
actions-markstate and actions-unmarkstate with the new IconFactory.

Change-Id: I8caec19854a56fcd4fe2b55e7b159936430a1ec9
Resolves: #68975
Releases: master
Reviewed-on: http://review.typo3.org/42535
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Daniel Maier <dani-maier@gmx.de>
Tested-by: Daniel Maier <dani-maier@gmx.de>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
typo3/sysext/backend/Classes/History/RecordHistory.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php

index 9e48712..b0ded9d 100644 (file)
@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Backend\History;
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Backend\Backend\Avatar\Avatar;
 
@@ -92,9 +94,15 @@ class RecordHistory {
        protected $pageAccessCache = array();
 
        /**
+        * @var IconFactory
+        */
+       protected $iconFactory;
+
+       /**
         * Constructor for the class
         */
        public function __construct() {
+               $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                // GPvars:
                $this->element = $this->getArgument('element');
                $this->returnUrl = $this->getArgument('returnUrl');
@@ -434,11 +442,13 @@ class RecordHistory {
                        // Show link to mark/unmark state
                        if (!$entry['action']) {
                                if ($entry['snapshot']) {
-                    $image =  IconUtility::getSpriteIcon('actions-unmarkstate', array('title' => $GLOBALS['LANG']->getLL('unmarkState', TRUE)), array());
+                                       $title = $GLOBALS['LANG']->getLL('unmarkState', TRUE);
+                                       $image = $this->iconFactory->getIcon('actions-unmarkstate', Icon::SIZE_SMALL);
                                } else {
-                    $image =  IconUtility::getSpriteIcon('actions-markstate', array('title' => $GLOBALS['LANG']->getLL('markState', TRUE)), array());
+                                       $title = $GLOBALS['LANG']->getLL('markState', TRUE);
+                                       $image = $this->iconFactory->getIcon('actions-markstate', Icon::SIZE_SMALL);
                                }
-                               $singleLine[] = $this->linkPage($image, array('highlight' => $entry['uid']));
+                               $singleLine[] = $this->linkPage($image, array('highlight' => $entry['uid']), '', $title);
                        } else {
                                $singleLine[] = '';
                        }
index 865f15f..c528be0 100644 (file)
@@ -182,6 +182,18 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'name' => 'upload',
                        )
                ),
+               'actions-markstate' => array(
+                       'provider' => FontawesomeIconProvider::class,
+                       'options' => array(
+                               'name' => 'square-o',
+                       )
+               ),
+               'actions-unmarkstate' => array(
+                       'provider' => FontawesomeIconProvider::class,
+                       'options' => array(
+                               'name' => 'check-square-o',
+                       )
+               ),
 
                // OVERLAYS
                'overlay-read-only' => array(