[TASK] Replace sprite icon "apps-filetree-root" with the new IconFactory 05/43205/3
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 11 Sep 2015 14:16:03 +0000 (16:16 +0200)
committerFrank Nägler <frank.naegler@typo3.org>
Fri, 11 Sep 2015 15:04:20 +0000 (17:04 +0200)
Replaces all IconUtility::getSpriteIcon calls for the icon
apps-filetree-root with the new IconFactory.

Resolves: #69680
Releases: master
Change-Id: I4f3518c054f4cc9e7d4a61e17fee4b21aef4b681
Reviewed-on: http://review.typo3.org/43205
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
typo3/sysext/backend/Classes/Controller/File/CreateFolderController.php
typo3/sysext/backend/Classes/Controller/File/EditFileController.php
typo3/sysext/backend/Classes/Controller/File/FileUploadController.php
typo3/sysext/backend/Classes/Controller/File/RenameFileController.php
typo3/sysext/backend/Classes/Controller/File/ReplaceFileController.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php

index 62a47fa..7152778 100644 (file)
@@ -90,6 +90,7 @@ class CreateFolderController implements \TYPO3\CMS\Core\Http\ControllerInterface
        /**
         * Initialize
         *
+        * @throws \TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException
         * @return void
         */
        protected function init() {
@@ -112,7 +113,9 @@ class CreateFolderController implements \TYPO3\CMS\Core\Http\ControllerInterface
                }
 
                // Setting the title and the icon
-               $icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('apps-filetree-root');
+               /** @var IconFactory $iconFactory */
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+               $icon = $iconFactory->getIcon('apps-filetree-root', Icon::SIZE_SMALL);
                $this->title = $icon . htmlspecialchars($this->folderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->folderObject->getIdentifier());
                // Setting template object
                $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
index 6321bf2..497e542 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Controller\File;
  */
 
 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;
@@ -114,7 +113,9 @@ class EditFileController implements \TYPO3\CMS\Core\Http\ControllerInterface {
                }
 
                // Setting the title and the icon
-               $icon = IconUtility::getSpriteIcon('apps-filetree-root');
+               /** @var IconFactory $iconFactory */
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+               $icon = $iconFactory->getIcon('apps-filetree-root', Icon::SIZE_SMALL);
                $this->title = $icon . htmlspecialchars($this->fileObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->fileObject->getIdentifier());
 
                // Setting template object
index 823b7b4..d9050d3 100644 (file)
@@ -105,7 +105,9 @@ class FileUploadController implements \TYPO3\CMS\Core\Http\ControllerInterface {
                        throw new \RuntimeException($title . ': ' . $message, 1294586843);
                }
                // Setting the title and the icon
-               $icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('apps-filetree-root');
+               /** @var IconFactory $iconFactory */
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+               $icon = $iconFactory->getIcon('apps-filetree-root', Icon::SIZE_SMALL);
                $this->title = $icon . htmlspecialchars($this->folderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->folderObject->getIdentifier());
                // Setting template object
                $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
index 19c6a90..98ce1e2 100644 (file)
@@ -114,7 +114,9 @@ class RenameFileController implements \TYPO3\CMS\Core\Http\ControllerInterface {
                        }
                }
                // Setting icon and title
-               $icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('apps-filetree-root');
+               /** @var IconFactory $iconFactory */
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+               $icon = $iconFactory->getIcon('apps-filetree-root', Icon::SIZE_SMALL);
                $this->title = $icon . htmlspecialchars($this->fileOrFolderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->fileOrFolderObject->getIdentifier());
                // Setting template object
                $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
index c7ffde4..d032889 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller\File;
 
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 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\Resource\Exception\InsufficientFileAccessPermissionsException;
@@ -120,7 +119,9 @@ class ReplaceFileController implements \TYPO3\CMS\Core\Http\ControllerInterface
                        }
                }
                // Setting icon and title
-               $icon = IconUtility::getSpriteIcon('apps-filetree-root');
+               /** @var IconFactory $iconFactory */
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+               $icon = $iconFactory->getIcon('apps-filetree-root', Icon::SIZE_SMALL);
                $this->title = $icon . htmlspecialchars($this->fileOrFolderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->fileOrFolderObject->getIdentifier());
                // Setting template object
                $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
index e9b0294..24d7d60 100644 (file)
@@ -46,6 +46,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'source' => 'EXT:t3skin/images/icons/apps/filetree-folder-default.png',
                        )
                ),
+               'apps-filetree-root' => array(
+                       'provider' => BitmapIconProvider::class,
+                       'options' => array(
+                               'source' => 't3skin/images/icons/apps/filetree-root.png',
+                       )
+               ),
                'apps-toolbar-menu-cache' => array(
                        'provider' => FontawesomeIconProvider::class,
                        'options' => array(