[TASK] Replace sprite icon "actions-document-paste-into" with IconFactory 16/42416/6
authorMarkus Guenther <mail@markus-guenther.de>
Mon, 10 Aug 2015 18:29:23 +0000 (20:29 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 10 Aug 2015 18:49:30 +0000 (20:49 +0200)
Replaces all IconUtility::getSpriteIcon calls for the icon
actions-document-paste-into with the new IconFactory.

Change-Id: Ia83c97ab29c0335f4a399467c8733c09f65f7a74
Resolves: #68865
Releases: master
Reviewed-on: http://review.typo3.org/42416
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/filelist/Classes/FileList.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index f896b67..1b8cbcf 100644 (file)
@@ -1072,7 +1072,7 @@ class ClickMenu {
                        $conf = $loc;
                }
                $editOnClick = 'if(' . $conf . '){' . $loc . '.location.href=' . GeneralUtility::quoteJSvalue($this->clipObj->pasteUrl('_FILE', $path, 0) . '&redirect=') . '+top.rawurlencode(' . $this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search);  };top.nav.refresh();';
-               return $this->linkItem($this->label('pasteinto'), IconUtility::getSpriteIcon('actions-document-paste-into'), $editOnClick . 'return false;');
+               return $this->linkItem($this->label('pasteinto'), $this->iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL), $editOnClick . 'return false;');
        }
 
        /**
index 018df5a..1983442 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Backend\Form\Element;
 use TYPO3\CMS\Backend\Form\FormEngine;
 use TYPO3\CMS\Backend\Form\DataPreprocessor;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Lang\LanguageService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Backend\Form\Utility\FormEngineUtility;
@@ -99,6 +100,18 @@ abstract class AbstractFormElement extends AbstractNode {
        }
 
        /**
+        * @var IconFactory
+        */
+       protected $iconFactory;
+
+       /**
+        * Construct
+        */
+       public function __construct() {
+               $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+       }
+
+       /**
         * Rendering wizards for form fields.
         *
         * @param array $itemKinds Array with the real item in the first value
@@ -625,7 +638,7 @@ abstract class AbstractFormElement extends AbstractNode {
                                        <a href="#"
                                                onclick="' . htmlspecialchars($aOnClick) . '"
                                                title="' . htmlspecialchars(sprintf($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.clipInsert_' . ($mode == 'db' ? 'db' : 'file')), count($clipElements))) . '">
-                                               ' . IconUtility::getSpriteIcon('actions-document-paste-into') . '
+                                               ' . $this->iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL) . '
                                        </a>';
                        }
                }
index 195c32b..cfbf79b 100644 (file)
@@ -1103,7 +1103,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                                . '" onclick="' . htmlspecialchars(('return '
                                                . $this->clipboard->confirmMsg('pages', $this->pageRecord, 'into', $elFromTable, $colName)))
                                                . '" title="' . $this->getLanguageService()->getLL('pasteIntoColumn', TRUE) . '">'
-                                               . IconUtility::getSpriteIcon('actions-document-paste-into') . '</a>';
+                                               . $this->iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL) . '</a>';
                                }
                        }
                }
index 8f2b6b3..a72e9f0 100644 (file)
@@ -104,6 +104,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'name' => 'check-square-o',
                        )
                ),
+               'actions-document-paste-into' => array(
+                       'provider' => FontawesomeIconProvider::class,
+                       'options' => array(
+                               'name' => 'clipboard',
+                       )
+               ),
                'actions-document-view' => array(
                        'provider' => FontawesomeIconProvider::class,
                        'options' => array(
index a5854a4..13b1384 100644 (file)
@@ -870,7 +870,7 @@ class FileList extends AbstractRecordList {
                                $elToConfirm[$key] = $clipBoardElement->getName();
                        }
                        if ($addPasteButton) {
-                               $cells[] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $fullIdentifier)) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $fullName, 'into', $elToConfirm)) . '" title="' . $this->getLanguageService()->getLL('clip_pasteInto', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-paste-into') . '</a>';
+                               $cells[] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $fullIdentifier)) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $fullName, 'into', $elToConfirm)) . '" title="' . $this->getLanguageService()->getLL('clip_pasteInto', TRUE) . '">' . $this->iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL) . '</a>';
                        }
                }
                // Compile items into a DIV-element:
index 7b09113..a175220 100644 (file)
@@ -1577,7 +1577,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                        $cells['pasteInto'] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->pasteUrl('', $row['uid']))
                                . '" onclick="' . htmlspecialchars('return ' . $this->clipObj->confirmMsg($table, $row, 'into', $elFromTable))
                                . '" title="' . $this->getLanguageService()->getLL('clip_pasteInto', TRUE) . '">'
-                               . IconUtility::getSpriteIcon('actions-document-paste-into') . '</a>';
+                               . $this->iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL) . '</a>';
                }
                /**
                 * @hook makeClip: Allows to change clip-icons of records in list-module