[TASK] Replace sprite icon "actions-edit-restore" with the new IconFactory 05/43005/2
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 4 Sep 2015 06:24:52 +0000 (08:24 +0200)
committerFrank Nägler <frank.naegler@typo3.org>
Fri, 4 Sep 2015 13:12:50 +0000 (15:12 +0200)
Replaces all IconUtility::getSpriteIcon calls for the icon
actions-edit-restore with the new IconFactory.

Resolves: #68935
Releases: master
Change-Id: I3a78882571a0cf9173cd099e238a8d822015b5cc
Reviewed-on: http://review.typo3.org/43005
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
typo3/sysext/core/Classes/Database/QueryView.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/lang/locallang_t3lib_fullsearch.xlf

index 08614c6..064327e 100644 (file)
@@ -56,10 +56,16 @@ class QueryView {
        protected $formName = '';
 
        /**
+        * @var \TYPO3\CMS\Core\Imaging\IconFactory
+        */
+       protected $iconFactory;
+
+       /**
         * constructor
         */
        public function __construct() {
                $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_t3lib_fullsearch.xlf');
+               $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
        }
 
        /**
@@ -549,8 +555,8 @@ class QueryView {
                        $out .= '<a class="btn btn-default" href="' . GeneralUtility::linkThisUrl(BackendUtility::getModuleUrl('tce_db'), array(
                                        ('cmd[' . $table . '][' . $row['uid'] . '][undelete]') => '1',
                                        'redirect' => GeneralUtility::linkThisScript(array())
-                               )) . BackendUtility::getUrlToken('tceAction') . '">';
-                       $out .= \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-restore', array('title' => 'undelete only')) . '</a>';
+                               )) . BackendUtility::getUrlToken('tceAction') . '" title="' . $GLOBALS['LANG']-getLL('undelete_only', TRUE) . '">';
+                       $out .= $this->iconFactory->getIcon('actions-edit-restore', Icon::SIZE_SMALL) . '</a>';
                        $formEngineParameters = array(
                                'edit[' . $table . '][' . $row['uid'] . ']' => 'edit',
                                'returnUrl' => GeneralUtility::linkThisScript(array())
index 44bf196..4b5404f 100644 (file)
@@ -232,6 +232,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'name' => 'retweet',
                        )
                ),
+               'actions-edit-restore' => array(
+                       'provider' => BitmapIconProvider::class,
+                       'options' => array(
+                               'source' => 'EXT:t3skin/images/icons/actions/edit-restore.png',
+                       )
+               ),
                'actions-edit-undo' => array(
                        'provider' => FontawesomeIconProvider::class,
                        'options' => array(
index 66c909c..a0358af 100644 (file)
@@ -18,6 +18,9 @@
                        <trans-unit id="query_removed">
                                <source>"%s" query entry removed!</source>
                        </trans-unit>
+                       <trans-unit id="undelete_only">
+                               <source>undelete only</source>
+                       </trans-unit>
                </body>
        </file>
 </xliff>