[!!!][TASK] Deprecate IconUtility 13/42613/40
authorFrank Nägler <frank.naegler@typo3.org>
Tue, 15 Sep 2015 16:55:07 +0000 (18:55 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 22 Sep 2015 14:23:15 +0000 (16:23 +0200)
Deprecate the IconUtility class from EXT:backend and handle its calls
using the new IconFactory from EXT:core.

Kudos to Benjamin Kott, Stephan Großberndt, Andreas Fernandez
and Frans Saris for the great support on this big project.

Resolves: #69057
Releases: master
Change-Id: I27a045b7a3b9d31e6e3e915e1452d44af56b0cee
Reviewed-on: http://review.typo3.org/42613
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Benjamin Kott <info@bk2k.info>
Tested-by: Benjamin Kott <info@bk2k.info>
Reviewed-by: Stephan Großberndt <stephan@grossberndt.de>
Tested-by: Stephan Großberndt <stephan@grossberndt.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
104 files changed:
Build/Resources/Public/Less/Component/icon.less
Build/Resources/Public/Less/TYPO3/_element_pagetree.less
Build/Resources/Public/Less/TYPO3/_element_slider.less
typo3/sysext/backend/Classes/Backend/Avatar/Avatar.php
typo3/sysext/backend/Classes/Backend/ToolbarItems/ClearCacheToolbarItem.php
typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/backend/Classes/Clipboard/Clipboard.php
typo3/sysext/backend/Classes/Configuration/TranslationConfigurationProvider.php
typo3/sysext/backend/Classes/Controller/BackendLayoutWizardController.php
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Classes/Controller/File/FileController.php
typo3/sysext/backend/Classes/Controller/NewRecordController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Controller/PageTreeNavigationController.php
typo3/sysext/backend/Classes/Controller/Wizard/TableController.php
typo3/sysext/backend/Classes/Form/Element/GroupElement.php
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseSystemLanguageRows.php
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php
typo3/sysext/backend/Classes/Form/Utility/FormEngineUtility.php
typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php
typo3/sysext/backend/Classes/RecordList/AbstractRecordList.php
typo3/sysext/backend/Classes/RecordList/ElementBrowserRecordList.php
typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php
typo3/sysext/backend/Classes/Tree/Pagetree/ExtdirectTreeDataProvider.php
typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php
typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php
typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php
typo3/sysext/backend/Classes/Utility/IconUtility.php
typo3/sysext/backend/Classes/Utility/IconUtilityOverrideResourceIconHookInterface.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Resources/Public/JavaScript/DragUploader.js
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/app.js
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/deletiondropzone.js
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/toppanel.js
typo3/sysext/backend/Tests/Unit/Controller/File/FileControllerTest.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php
typo3/sysext/backend/Tests/Unit/Utility/IconUtilityTest.php
typo3/sysext/belog/Classes/ViewHelpers/HistoryEntryViewHelper.php
typo3/sysext/beuser/Classes/Controller/PermissionAjaxController.php
typo3/sysext/beuser/Classes/ViewHelpers/RemoveUserViewHelper.php
typo3/sysext/beuser/Classes/ViewHelpers/SwitchUserViewHelper.php
typo3/sysext/compatibility6/Classes/Hooks/ExtTablesPostProcessing/TcaMigration.php
typo3/sysext/compatibility6/Migrations/Code/ClassAliasMap.php
typo3/sysext/compatibility6/Migrations/Code/LegacyClassesForIde.php
typo3/sysext/core/Classes/Imaging/IconFactory.php
typo3/sysext/core/Classes/Imaging/IconRegistry.php
typo3/sysext/core/Classes/Migrations/TcaMigration.php
typo3/sysext/core/Classes/Tree/TableConfiguration/DatabaseTreeDataProvider.php
typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php
typo3/sysext/core/Configuration/TCA/pages.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-69057-DeprecateIconUtilityAndMoveMethodsIntoIconFactory.rst [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Deprecation-69057-DeprecateIconUtilityAndMoveMethodsIntoIconFactory.rst [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Imaging/IconFactoryTest.php
typo3/sysext/documentation/Classes/Slots/ExtensionManager.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/ConfigureExtensionViewHelper.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/DownloadExtensionDataViewHelper.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/RemoveExtensionViewHelper.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/UpdateScriptViewHelper.php
typo3/sysext/feedit/Classes/FrontendEditPanel.php
typo3/sysext/filelist/Classes/Controller/FileListController.php
typo3/sysext/filelist/Classes/FileList.php
typo3/sysext/form/Configuration/TCA/Overrides/tt_content.php
typo3/sysext/frontend/Classes/Controller/TranslationStatusController.php
typo3/sysext/frontend/Classes/View/AdminPanelView.php
typo3/sysext/frontend/Configuration/TCA/sys_domain.php
typo3/sysext/frontend/Configuration/TCA/sys_template.php
typo3/sysext/impexp/Classes/Controller/ImportExportController.php
typo3/sysext/impexp/Classes/View/ExportPageTreeView.php
typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php
typo3/sysext/info/Classes/Controller/InfoModuleController.php
typo3/sysext/info_pagetsconfig/Classes/Controller/InfoPageTyposcriptConfigController.php
typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php
typo3/sysext/lowlevel/Classes/View/DatabaseIntegrityView.php
typo3/sysext/opendocs/Classes/Backend/ToolbarItems/OpendocsToolbarItem.php
typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php
typo3/sysext/recordlist/Classes/Tree/View/ElementBrowserPageTreeView.php
typo3/sysext/recycler/Classes/Controller/DeletedRecordsController.php
typo3/sysext/sys_action/Classes/Backend/ToolbarItems/ActionToolbarItem.php
typo3/sysext/t3skin/Classes/Slot/IconStyleModifier.php [deleted file]
typo3/sysext/t3skin/Resources/Public/Css/backend.css
typo3/sysext/t3skin/ext_localconf.php
typo3/sysext/t3skin/ext_tables.php
typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateConstantEditorModuleFunctionController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php
typo3/sysext/version/Classes/Controller/VersionModuleController.php
typo3/sysext/version/Classes/Hook/IconUtilityHook.php [deleted file]
typo3/sysext/version/ext_localconf.php
typo3/sysext/wizard_crpages/Classes/Controller/CreatePagesWizardModuleFunctionController.php
typo3/sysext/workspaces/Classes/Controller/AbstractController.php
typo3/sysext/workspaces/Classes/ExtDirect/ExtDirectServer.php
typo3/sysext/workspaces/Classes/Service/GridDataService.php
typo3/sysext/workspaces/Configuration/TCA/sys_workspace.php
typo3/sysext/workspaces/Configuration/TCA/sys_workspace_stage.php
typo3/sysext/workspaces/Resources/Public/JavaScript/Component/RowExpander.js
typo3/sysext/workspaces/Resources/Public/JavaScript/configuration.js

index e3f33ad..7d3a3d4 100644 (file)
        color: @gray;
 }
 
+.icon-status-dialog-information {
+       color: @brand-info;
+}
+
 .icon-status-dialog-ok,
 .icon-status-status-permission-granted {
        color: @brand-success;
index 94de453..e5f638b 100644 (file)
 }
 
 #typo3-pagetree-topPanel-filterWrap .t3-icon-input-clear {
-       right: 2px;
+       position: absolute;
+       right: 6px;
+       top: 3px;
 }
 
 #typo3-pagetree-topPanel-defaultPanel {
index 2b0e92e..a691276 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Boostrap Slider
+// Bootstrap Slider
 //
 // This is a custom less implementation for the value slider in the backend
 // based on https://github.com/seiyria/bootstrap-slider
        .slider-track {
                cursor: not-allowed;
        }
-}
\ No newline at end of file
+}
index 114125b..3a33683 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Backend\Backend\Avatar;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Service\DependencyOrderingService;
index a995be9..ce9c112 100644 (file)
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
 use TYPO3\CMS\Backend\Toolbar\ClearCacheActionsHookInterface;
 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;
index a7eb804..8052c40 100644 (file)
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
 use TYPO3\CMS\Backend\Module\ModuleLoader;
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Database\PreparedStatement;
 use TYPO3\CMS\Core\Http\AjaxRequestHandler;
 use TYPO3\CMS\Core\Imaging\Icon;
index a5e5410..0871f88 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\ClickMenu;
 
 use TYPO3\CMS\Backend\Clipboard\Clipboard;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
index 714bdd8..b70a246 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Clipboard;
  */
 
 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\ResourceFactory;
index b850b0c..41a6716 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Configuration;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Lang\LanguageService;
index 03aef60..3bfca96 100644 (file)
@@ -18,7 +18,6 @@ use Psr\Http\Message\ServerRequestInterface;
 use Psr\Http\Message\ResponseInterface;
 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\Page\PageRenderer;
index 2f57a6c..3a1ca26 100644 (file)
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
 use Psr\Http\Message\ServerRequestInterface;
 use Psr\Http\Message\ResponseInterface;
 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\Folder;
index eada142..5d7980c 100644 (file)
@@ -17,11 +17,12 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
 use Psr\Http\Message\ServerRequestInterface;
 use Psr\Http\Message\ResponseInterface;
 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\Imaging\IconProvider\BitmapIconProvider;
+use TYPO3\CMS\Core\Imaging\IconRegistry;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\PathUtility;
+use TYPO3\CMS\Core\Utility\StringUtility;
 
 /**
  * Script Class for the New Content element wizard
@@ -117,6 +118,11 @@ class NewContentElementController {
        protected $MCONF;
 
        /**
+        * @var IconFactory
+        */
+       protected $iconFactory;
+
+       /**
         * Constructor
         */
        public function __construct() {
@@ -158,6 +164,8 @@ class NewContentElementController {
                $perms_clause = $this->getBackendUser()->getPagePermsClause(1);
                $this->pageInfo = BackendUtility::readPageAccess($this->id, $perms_clause);
                $this->access = is_array($this->pageInfo) ? 1 : 0;
+
+               $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
        }
 
        /**
@@ -228,6 +236,9 @@ class NewContentElementController {
                                        top.TYPO3ModuleMenu.refreshMenu();
                                }
                        ');
+
+                       $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);
+
                        // Traverse items for the wizard.
                        // An item is either a header or an item rendered with a radio button and title/description and icon:
                        $cc = ($key = 0);
@@ -252,19 +263,31 @@ class NewContentElementController {
                                                $aOnClick = "document.editForm.defValues.value=unescape('" . rawurlencode($wInfo['params']) . "');goToalt_doc();" . (!$this->onClickEvent?"window.location.hash='#sel2';":'');
                                        }
 
-                                       $icon = $wInfo['icon'];
-                                       if (strpos($wInfo['icon'], '..') === FALSE && !GeneralUtility::isAbsPath($icon)) {
-                                               $icon = GeneralUtility::getFileAbsFileName($icon, TRUE, TRUE);
-                                               $pathInfo = PathUtility::pathinfo($icon);
-                                               $path = PathUtility::getRelativePathTo($pathInfo['dirname']);
-                                               $icon = $path . $pathInfo['basename'];
+                                       if (isset($wInfo['icon'])) {
+                                               GeneralUtility::deprecationLog('The PageTS-Config: mod.wizards.newContentElement.wizardItems.*.elements.*.icon'
+                                                       . ' is deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8.'
+                                                       . ' Register your icon in IconRegistry::registerIcon and use the new setting:'
+                                                       . ' mod.wizards.newContentElement.wizardItems.*.elements.*.iconIdentifier'
+                                               );
+                                               $wInfo['iconIdentifier'] = 'content-' . $k;
+                                               $icon = $wInfo['icon'];
+                                               if (StringUtility::beginsWith($icon, '../typo3conf/ext/')) {
+                                                       $icon = str_replace('../typo3conf/ext/', 'EXT:', $icon);
+                                               }
+                                               if (!StringUtility::beginsWith($icon, 'EXT:') && strpos($icon, '/') !== FALSE) {
+                                                       $icon = TYPO3_mainDir . GeneralUtility::resolveBackPath($wInfo['icon']);
+                                               }
+                                               $iconRegistry->registerIcon($wInfo['iconIdentifier'], BitmapIconProvider::class, array(
+                                                       'source' => $icon
+                                               ));
                                        }
+                                       $icon = $this->iconFactory->getIcon($wInfo['iconIdentifier']);
                                        $menuItems[$key]['content'] .= '
                                                <div class="media">
                                                        <a href="#" onclick="' . htmlspecialchars($aOnClick) . '">
                                                                ' . $content . '
                                                                <div class="media-left">
-                                                                       <img' . IconUtility::skinImg('', $icon) . ' alt="" />
+                                                                       ' . $icon . '
                                                                </div>
                                                                <div class="media-body">
                                                                        <strong>' . htmlspecialchars($wInfo['title']) . '</strong>' .
@@ -339,11 +362,10 @@ class NewContentElementController {
                        'csh' => '',
                        'back' => ''
                );
-               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                if ($this->id && $this->access) {
                        $buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'new_ce');
                        if ($this->R_URI) {
-                               $buttons['back'] = '<a href="' . htmlspecialchars($this->R_URI) . '" class="typo3-goBack" title="' . $this->getLanguageService()->getLL('goBack', TRUE) . '">' . $iconFactory->getIcon('actions-view-go-back', Icon::SIZE_SMALL) . '</a>';
+                               $buttons['back'] = '<a href="' . htmlspecialchars($this->R_URI) . '" class="typo3-goBack" title="' . $this->getLanguageService()->getLL('goBack', TRUE) . '">' . $this->iconFactory->getIcon('actions-view-go-back', Icon::SIZE_SMALL) . '</a>';
                        }
                }
                return $buttons;
index 8ec7afe..f6ecfd5 100644 (file)
@@ -17,6 +17,8 @@ namespace TYPO3\CMS\Backend\Controller\File;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Core\Http\AjaxRequestHandler;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Resource\DuplicationBehavior;
 use TYPO3\CMS\Core\Resource\Folder;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -267,11 +269,12 @@ class FileController {
                                        $thumbUrl = $processedFile->getPublicUrl(TRUE);
                                }
                        }
+                       $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                        $result = array_merge(
                                $result->toArray(),
                                array (
                                        'date' => BackendUtility::date($result->getModificationTime()),
-                                       'iconClasses' => \TYPO3\CMS\Backend\Utility\IconUtility::mapFileExtensionToSpriteIconClass($result->getExtension()),
+                                       'icon' => $iconFactory->getIconForFileExtension($result->getExtension(), Icon::SIZE_SMALL)->render(),
                                        'thumbUrl' => $thumbUrl
                                )
                        );
index 9bee956..e73ed15 100644 (file)
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Backend\Controller;
 use Psr\Http\Message\ServerRequestInterface;
 use Psr\Http\Message\ResponseInterface;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
index 671d3e5..a86f4c0 100755 (executable)
@@ -22,7 +22,6 @@ use TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord;
 use TYPO3\CMS\Backend\Form\FormResultCompiler;
 use TYPO3\CMS\Backend\Form\NodeFactory;
 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\Page\PageRenderer;
index 7352284..7b4195b 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Controller;
 
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Backend\View\PageTreeView;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
index 2e80fd0..44abf44 100644 (file)
@@ -18,7 +18,6 @@ use Psr\Http\Message\ServerRequestInterface;
 use Psr\Http\Message\ResponseInterface;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools;
 use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Core\Imaging\Icon;
index dd0b965..9bd4c30 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Form\Element;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
index 69440d0..f3ce91d 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Form\FormDataProvider;
 
 use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
index f74472b..8619ed8 100644 (file)
@@ -18,10 +18,10 @@ use TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider;
 use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
 use TYPO3\CMS\Backend\Module\ModuleLoader;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Database\RelationHandler;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
 use TYPO3\CMS\Core\Messaging\FlashMessageService;
@@ -141,8 +141,6 @@ class TcaSelectItems extends AbstractItemProvider implements FormDataProviderInt
         * @throws \UnexpectedValueException
         */
        protected function addItemsFromSpecial(array $result, $fieldName, array $items) {
-               $languageService = $this->getLanguageService();
-
                // Guard
                if (empty($result['processedTca']['columns'][$fieldName]['config']['special'])
                        || !is_string($result['processedTca']['columns'][$fieldName]['config']['special'])
@@ -150,6 +148,9 @@ class TcaSelectItems extends AbstractItemProvider implements FormDataProviderInt
                        return $items;
                }
 
+               $languageService = $this->getLanguageService();
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+
                $special = $result['processedTca']['columns'][$fieldName]['config']['special'];
                if ($special === 'tables') {
                        foreach ($GLOBALS['TCA'] as $currentTable => $_) {
@@ -158,7 +159,7 @@ class TcaSelectItems extends AbstractItemProvider implements FormDataProviderInt
                                        continue;
                                }
                                $label = !empty($GLOBALS['TCA'][$currentTable]['ctrl']['title']) ? $GLOBALS['TCA'][$currentTable]['ctrl']['title'] : '';
-                               $icon = IconUtility::mapRecordTypeToSpriteIconName($currentTable, array());
+                               $icon = $iconFactory->mapRecordTypeToIconIdentifier($currentTable, array());
                                $helpText = array();
                                $languageService->loadSingleTableDescription($currentTable);
                                // @todo: check if this actually works, currently help texts are missing
@@ -180,7 +181,7 @@ class TcaSelectItems extends AbstractItemProvider implements FormDataProviderInt
                                        }
                                        $label = $specialItem[0];
                                        $value = $specialItem[1];
-                                       $icon = IconUtility::mapRecordTypeToSpriteIconName('pages', array('doktype' => $specialItem[1]));
+                                       $icon = $iconFactory->mapRecordTypeToIconIdentifier('pages', array('doktype' => $specialItem[1]));
                                        $items[] = array($label, $value, $icon);
                                }
                        }
@@ -193,7 +194,7 @@ class TcaSelectItems extends AbstractItemProvider implements FormDataProviderInt
                                $theField = array_pop($theFieldParts);
                                // Add header if not yet set for table:
                                if (!array_key_exists($theTable, $items)) {
-                                       $icon = IconUtility::mapRecordTypeToSpriteIconName($theTable, array());
+                                       $icon = $iconFactory->mapRecordTypeToIconIdentifier($theTable, array());
                                        $items[$theTable] = array(
                                                $GLOBALS['TCA'][$theTable]['ctrl']['title'],
                                                '--div--',
@@ -422,6 +423,8 @@ class TcaSelectItems extends AbstractItemProvider implements FormDataProviderInt
                        $iconPath = $result['processedTca']['ctrl']['selicon_field_path'];
                }
 
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+
                while ($foreignRow = $database->sql_fetch_assoc($queryResource)) {
                        BackendUtility::workspaceOL($foreignTable, $foreignRow);
                        if (is_array($foreignRow)) {
@@ -430,7 +433,7 @@ class TcaSelectItems extends AbstractItemProvider implements FormDataProviderInt
                                        $iParts = GeneralUtility::trimExplode(',', $foreignRow[$iconFieldName], TRUE);
                                        $icon = '../' . $iconPath . '/' . trim($iParts[0]);
                                } else {
-                                       $icon = IconUtility::mapRecordTypeToSpriteIconName($foreignTable, $foreignRow);
+                                       $icon = $iconFactory->mapRecordTypeToIconIdentifier($foreignTable, $foreignRow);
                                }
                                // Add the item
                                $items[] = array(
index 1b55308..b156e5c 100644 (file)
@@ -19,13 +19,10 @@ use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\PathUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Utility\StringUtility;
 use TYPO3\CMS\Lang\LanguageService;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
-use TYPO3\CMS\Core\Utility\MathUtility;
-use TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 
 /**
index 2a3bad6..e8fcffe 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Form\Wizard;
  */
 
 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;
index 5a918d6..62a0c31 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\RecordList;
  */
 
 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;
index ff22b87..6bc9654 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\RecordList;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Recordlist\Browser\ElementBrowser;
index 8c40933..3b4f2c1 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Search\LiveSearch;
  */
 
 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\Type\Bitmask\Permission;
index fbb9e0c..2f1ee73 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Template;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
index 3e39dc3..ebdf2f9 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Tree\Pagetree;
  */
 
 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;
index a0bfbf4..8dd5dcd 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Backend\Tree\Pagetree;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation;
@@ -133,11 +132,11 @@ class ExtdirectTreeDataProvider extends \TYPO3\CMS\Backend\Tree\AbstractExtJsTre
                                continue;
                        }
                        $label = $GLOBALS['LANG']->sL($doktypeLabelMap[$doktype], TRUE);
-                       $spriteIcon = IconUtility::getSpriteIconClasses($GLOBALS['TCA']['pages']['ctrl']['typeicon_classes'][$doktype]);
+                       $icon = $this->iconFactory->getIcon($GLOBALS['TCA']['pages']['ctrl']['typeicon_classes'][$doktype], Icon::SIZE_SMALL)->render();
                        $output[] = array(
                                'nodeType' => $doktype,
                                'cls' => 'typo3-pagetree-topPanel-button',
-                               'iconCls' => $spriteIcon,
+                               'html' => $icon,
                                'title' => $label,
                                'tooltip' => $label
                        );
@@ -164,7 +163,7 @@ class ExtdirectTreeDataProvider extends \TYPO3\CMS\Backend\Tree\AbstractExtJsTre
        /**
         * Returns the language labels, sprites and configuration options for the pagetree
         *
-        * @return void
+        * @return array
         */
        public function loadResources() {
                $file = 'LLL:EXT:lang/locallang_core.xlf:';
@@ -194,16 +193,14 @@ class ExtdirectTreeDataProvider extends \TYPO3\CMS\Backend\Tree\AbstractExtJsTre
                                'indicator' => $indicators['html'],
                                'temporaryMountPoint' => Commands::getMountPointPath()
                        ),
-                       'Sprites' => array(
-                               'InputClear' => IconUtility::getSpriteIconClasses('actions-input-clear'),
-                               'TrashCan' => IconUtility::getSpriteIconClasses('actions-edit-delete'),
-                               'TrashCanRestore' => IconUtility::getSpriteIconClasses('actions-edit-restore'),
-                               'Info' => IconUtility::getSpriteIconClasses('actions-document-info')
-                       ),
                        'Icons' => array(
-                               'NewNode' => (string)$this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL),
-                               'Filter' => (string)$this->iconFactory->getIcon('actions-filter', Icon::SIZE_SMALL),
-                               'Refresh' => (string)$this->iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL)
+                               'InputClear' => $this->iconFactory->getIcon('actions-input-clear', Icon::SIZE_SMALL)->render(),
+                               'TrashCan' => $this->iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL)->render(),
+                               'TrashCanRestore' => $this->iconFactory->getIcon('actions-edit-restore', Icon::SIZE_SMALL)->render(),
+                               'Info' => $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render(),
+                               'NewNode' => $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL)->render(),
+                               'Filter' => $this->iconFactory->getIcon('actions-filter', Icon::SIZE_SMALL)->render(),
+                               'Refresh' => $this->iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL)->render()
                        )
                );
                return $configuration;
index 406dbb6..de1585b 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Tree\View;
  */
 
 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;
index 9905859..63ecf5b 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Backend\Tree\View;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
index fd53eda..dfed6b6 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Backend\Tree\View;
  */
 
 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\ExtensionManagementUtility;
index 30a3b9f..efa197f 100644 (file)
@@ -15,6 +15,8 @@ namespace TYPO3\CMS\Backend\Utility;
  */
 
 use TYPO3\CMS\Core\Imaging\GraphicalFunctions;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Versioning\VersionState;
 
@@ -31,6 +33,7 @@ use TYPO3\CMS\Core\Versioning\VersionState;
  * Notes:
  * These functions are strongly related to the interface of TYPO3.
  * Static class, functions called without making a class instance.
+ * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use IconFactory instead
  */
 class IconUtility {
 
@@ -151,14 +154,17 @@ class IconUtility {
                        }
                }
                // First, find the icon file name. This can depend on configuration in TCA, field values and more:
-               if ($table == 'pages') {
+               if ($table === 'pages') {
                        $iconfile = $GLOBALS['PAGES_TYPES'][$row['doktype']]['icon'];
-                       if (!$iconfile) {
+                       if (empty($iconfile)) {
                                $iconfile = $GLOBALS['PAGES_TYPES']['default']['icon'];
                        }
-               } else {
+               }
+
+               if (empty($iconfile)) {
                        $iconfile = $GLOBALS['TCA'][$table]['ctrl']['iconfile'] ?: $table . '.gif';
                }
+
                // Setting path of iconfile if not already set. Default is "gfx/i/"
                if (!strstr($iconfile, '/')) {
                        $iconfile = 'gfx/i/' . $iconfile;
@@ -275,9 +281,11 @@ class IconUtility {
         * @param string $wHattribs Default width/height, defined like 'width="12" height="14"'
         * @param int $outputMode Mode: 0 (zero) is default and returns src/width/height. 1 returns value of src+backpath, 2 returns value of w/h.
         * @return string Returns ' src="[backPath][src]" [wHattribs]'
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8
         * @see skinImgFile()
         */
        static public function skinImg($backPath, $src, $wHattribs = '', $outputMode = 0) {
+               GeneralUtility::logDeprecatedFunction();
                static $cachedSkinImages = array();
                $imageId = md5($backPath . $src . $wHattribs . $outputMode);
                if (isset($cachedSkinImages[$imageId])) {
@@ -566,9 +574,11 @@ class IconUtility {
         * @param array $options An associative array with additional options and attributes for the tag. by default, the key is the name of the attribute, and the value is the parameter string that is set. However, there are some additional special reserved keywords that can be used as keys: "html" (which is the HTML that will be inside the icon HTML tag), "tagName" (which is an alternative tagName than "span"), and "class" (additional class names that will be merged with the sprite icon CSS classes)
         * @param array $overlays An associative array with the icon-name as key, and the options for this overlay as an array again (see the parameter $options again)
         * @return string The full HTML tag (usually a <span>)
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, use IconFactory->getIcon instead
         * @access public
         */
        static public function getSpriteIcon($iconName, array $options = array(), array $overlays = array()) {
+               GeneralUtility::logDeprecatedFunction();
                // Check if icon can be cached and return cached version if present
                if (empty($options) && empty($overlays)) {
                        if (isset(static::$spriteIconCache[$iconName])) {
@@ -617,18 +627,19 @@ class IconUtility {
         * the necessary icon.
         *
         * @param string $fileExtension The name of the icon to fetch, can be a file extension, full file path or one of the special keywords "folder" or "mount
-        * @param array $options An associative array with additional options and attributes for the tag. by default, the key is the name of the attribute, and the value is the parameter string that is set. However, there are some additional special reserved keywords that can be used as keys: "html" (which is the HTML that will be inside the icon HTML tag), "tagName" (which is an alternative tagName than "span"), and "class" (additional class names that will be merged with the sprite icon CSS classes)
-        * @return string The full HTML tag (usually a <span>)
+        * @param array $options not used anymore
+        * @return string The full HTML tag
         * @access public
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use IconFactory::getIconForFile directly
         */
-       static public function getSpriteIconForFile($fileExtension, array $options = array()) {
-               $innerHtml = isset($options['html']) ? $options['html'] : NULL;
-               $tagName = isset($options['tagName']) ? $options['tagName'] : NULL;
-               // Create the CSS class
-               $options['class'] = self::mapFileExtensionToSpriteIconClass($fileExtension) . (isset($options['class']) ? ' ' . $options['class'] : '');
-               unset($options['html']);
-               unset($options['tagName']);
-               return self::buildSpriteHtmlIconTag($options, $innerHtml, $tagName);
+       static public function getSpriteIconForFile($fileExtension, array $options = NULL) {
+               GeneralUtility::logDeprecatedFunction();
+               if ($options !== NULL) {
+                       GeneralUtility::deprecationLog('The parameter $options of IconUtility::getSpriteIconForFile is not used anymore');
+               }
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+
+               return $iconFactory->getIconForFileExtension($fileExtension)->render();
        }
 
        /**
@@ -687,27 +698,19 @@ class IconUtility {
         *
         * @param string $table The TCA table name
         * @param array $row The DB record of the TCA table
-        * @param array $options An associative array with additional options and attributes for the tag. by default, the key is the name of the attribute, and the value is the parameter string that is set. However, there are some additional special reserved keywords that can be used as keys: "html" (which is the HTML that will be inside the icon HTML tag), "tagName" (which is an alternative tagName than "span"), and "class" (additional class names that will be merged with the sprite icon CSS classes)
+        * @param array $options not used anymore
         * @return string The full HTML tag (usually a <span>)
         * @access public
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8
         */
-       static public function getSpriteIconForRecord($table, array $row, array $options = array()) {
-               $innerHtml = isset($options['html']) ? $options['html'] : NULL;
-               $tagName = isset($options['tagName']) ? $options['tagName'] : NULL;
-               // Overlay this record icon with the status of the row
-               $overlaySpriteIconName = self::mapRecordOverlayToSpriteIconName($table, $row);
-               if ($overlaySpriteIconName) {
-                       $overlayOptions = array(
-                               'html' => $innerHtml,
-                               'class' => 't3-icon-overlay'
-                       );
-                       $innerHtml = self::getSpriteIcon($overlaySpriteIconName, $overlayOptions);
+       static public function getSpriteIconForRecord($table, array $row, array $options = NULL) {
+               GeneralUtility::logDeprecatedFunction();
+               if ($options !== NULL) {
+                       GeneralUtility::deprecationLog('The parameter $options of IconUtility::getSpriteIconForRecord is not used anymore');
                }
-               // Fetch the name for the CSS class, based on the $row
-               $options['class'] = self::mapRecordTypeToSpriteIconClass($table, $row) . (isset($options['class']) ? ' ' . $options['class'] : '');
-               unset($options['html']);
-               unset($options['tagName']);
-               return self::buildSpriteHtmlIconTag($options, $innerHtml, $tagName);
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+
+               return $iconFactory->getIconForRecord($table, $row, Icon::SIZE_SMALL)->render();
        }
 
        /**
@@ -724,84 +727,19 @@ class IconUtility {
         *
         * @param \TYPO3\CMS\Core\Resource\ResourceInterface $resource
         * @param array $options An associative array with additional options and attributes for the tag. See self::getSpriteIcon()
-        * @param array $overlays An associative array with the icon-name as key, and the options for this overlay as an array again (see the parameter $options again)
+        * @param array $overlays not used anymore
         * @return string
         * @throws \UnexpectedValueException
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8
         */
-       static public function getSpriteIconForResource(\TYPO3\CMS\Core\Resource\ResourceInterface $resource, array $options = array(), array $overlays = array()) {
-               // Folder
-               if ($resource instanceof \TYPO3\CMS\Core\Resource\FolderInterface) {
-                       $iconName = NULL;
-                       $role = $resource->getRole();
-                       // non browsable storage
-                       if ($resource->getStorage()->isBrowsable() === FALSE && !empty($options['mount-root'])) {
-                               $iconName = 'apps-filetree-folder-locked';
-                       } else {
-                               // storage root
-                               if ($resource->getStorage()->getRootLevelFolder()->getIdentifier() === $resource->getIdentifier()) {
-                                       $iconName = 'apps-filetree-root';
-                               }
-
-
-                               // user/group mount root
-                               if (!empty($options['mount-root'])) {
-                                       $iconName = 'apps-filetree-mount';
-                                       if ($role === \TYPO3\CMS\Core\Resource\FolderInterface::ROLE_READONLY_MOUNT) {
-                                               $overlays['status-overlay-locked'] = array();
-                                       } elseif ($role === \TYPO3\CMS\Core\Resource\FolderInterface::ROLE_USER_MOUNT) {
-                                               $overlays['status-overlay-access-restricted'] = array();
-                                       }
-                               }
-
-                               if ($iconName === NULL) {
-                                       // in folder tree view $options['folder-open'] can define an open folder icon
-                                       if (!empty($options['folder-open'])) {
-                                               $iconName = 'apps-filetree-folder-opened';
-                                       } else {
-                                               $iconName = 'apps-filetree-folder-default';
-                                       }
-
-                                       if ($role === \TYPO3\CMS\Core\Resource\FolderInterface::ROLE_TEMPORARY) {
-                                               $iconName = 'apps-filetree-folder-temp';
-                                       } elseif ($role === \TYPO3\CMS\Core\Resource\FolderInterface::ROLE_RECYCLER) {
-                                               $iconName = 'apps-filetree-folder-recycler';
-                                       }
-                               }
-
-                               // if locked add overlay
-                               if ($resource instanceof \TYPO3\CMS\Core\Resource\InaccessibleFolder ||
-                                       !$resource->getStorage()->isBrowsable() ||
-                                       !$resource->getStorage()->checkFolderActionPermission('add', $resource)
-                               ) {
-                                       $overlays['status-overlay-locked'] = array();
-                               }
-                       }
-
-
-
-                       // File
-               } else {
-                       $iconName = self::mapFileExtensionToSpriteIconName($resource->getExtension());
-
-                       if ($resource instanceof \TYPO3\CMS\Core\Resource\File && $resource->isMissing()) {
-                               $overlays['status-overlay-missing'] = array();
-                       }
-               }
-
-               // Hook: allow some other process to influence the choice of icon and overlays
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideResourceIcon'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideResourceIcon'] as $classRef) {
-                               $hookObject = GeneralUtility::getUserObj($classRef);
-                               if (!$hookObject instanceof IconUtilityOverrideResourceIconHookInterface) {
-                                       throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Backend\Utility\IconUtilityOverrideResourceIconHookInterface::class, 1393574895);
-                               }
-                               $hookObject->overrideResourceIcon($resource, $iconName, $options, $overlays);
-                       }
+       static public function getSpriteIconForResource(\TYPO3\CMS\Core\Resource\ResourceInterface $resource, array $options = array(), array $overlays = NULL) {
+               GeneralUtility::logDeprecatedFunction();
+               if ($overlays !== NULL) {
+                       GeneralUtility::deprecationLog('The parameter $overlays of IconUtility::getSpriteIconForResource is not used anymore');
                }
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
 
-               unset($options['mount-root']);
-               unset($options['folder-open']);
-               return self::getSpriteIcon($iconName, $options, $overlays);
+               return $iconFactory->getIconForResource($resource, Icon::SIZE_SMALL, NULL, $options)->render();
        }
 
        /**
@@ -821,8 +759,10 @@ class IconUtility {
         * @param array $row The selected record
         * @return string The CSS class for the sprite icon of that DB record
         * @access private
+        * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8
         */
        static public function mapRecordTypeToSpriteIconClass($table, array $row) {
+               GeneralUtility::logDeprecatedFunction();
                return self::getSpriteIconClasses(self::mapRecordTypeToSpriteIconName($table, $row));
        }
 
@@ -914,102 +854,6 @@ class IconUtility {
        }
 
        /**
-        * this helper functions checks if the DB record ($row) has any special status
-        * based on the TCA settings like hidden, starttime etc, and then returns a specific
-        * Sprite icon class for the overlay of this DB record
-        * This method solely takes care of the overlay of this record, not any type
-        *
-        * Please note that this only returns one overlay, one status, that is prioritized
-        * by $GLOBALS['TYPO3_CONF_VARS']['BE']['spriteIconRecordOverlayPriorities']
-        * We wanted to not have these icons blown over by tons of overlays, so this is limited
-        * to just one.
-        *
-        * see ext:core/Configuration/DefaultConfiguration.php for the default options, you will find
-        * $GLOBALS['TYPO3_CONF_VARS']['BE']['spriteIconRecordOverlayNames'] that shows
-        * the list of CSS classes that will be used for the sprites, mapped to the statuses here
-        *
-        * @param string $table The TCA table
-        * @param array $row The selected record
-        * @return string The CSS class for the sprite icon of that DB record
-        * @access private
-        */
-       static public function mapRecordOverlayToSpriteIconName($table, array $row) {
-               $tcaCtrl = $GLOBALS['TCA'][$table]['ctrl'];
-               // Calculate for a given record the actual visibility at the moment
-               $status = array(
-                       'hidden' => FALSE,
-                       'starttime' => FALSE,
-                       'endtime' => FALSE,
-                       'futureendtime' => FALSE,
-                       'fe_group' => FALSE,
-                       'deleted' => FALSE,
-                       'protectedSection' => FALSE,
-                       'nav_hide' => (bool)$row['nav_hide'],
-                       'noIconFound' => (bool)$row['_NO_ICON_FOUND']
-               );
-               // Icon state based on "enableFields":
-               if (is_array($tcaCtrl['enablecolumns'])) {
-                       $enCols = $tcaCtrl['enablecolumns'];
-                       // If "hidden" is enabled:
-                       if ($tcaCtrl['enablecolumns']['disabled'] && $row[$tcaCtrl['enablecolumns']['disabled']]) {
-                               $status['hidden'] = TRUE;
-                       }
-                       // If a "starttime" is set and higher than current time:
-                       if ($tcaCtrl['enablecolumns']['starttime'] && $GLOBALS['EXEC_TIME'] < (int)$row[$tcaCtrl['enablecolumns']['starttime']]) {
-                               $status['starttime'] = TRUE;
-                       }
-                       // If an "endtime" is set
-                       if ($tcaCtrl['enablecolumns']['endtime']) {
-                               if ((int)$row[$tcaCtrl['enablecolumns']['endtime']] > 0) {
-                                       if ((int)$row[$tcaCtrl['enablecolumns']['endtime']] < $GLOBALS['EXEC_TIME']) {
-                                               // End-timing applies at this point.
-                                               $status['endtime'] = TRUE;
-                                       } else {
-                                               // End-timing WILL apply in the future for this element.
-                                               $status['futureendtime'] = TRUE;
-                                       }
-                               }
-                       }
-                       // If a user-group field is set
-                       if ($tcaCtrl['enablecolumns']['fe_group'] && $row[$tcaCtrl['enablecolumns']['fe_group']]) {
-                               $status['fe_group'] = TRUE;
-                       }
-               }
-               // If "deleted" flag is set (only when listing records which are also deleted!)
-               if ($row[$tcaCtrl['delete']]) {
-                       $status['deleted'] = TRUE;
-               }
-               // Detecting extendToSubpages (for pages only)
-               if ($table == 'pages' && $row['extendToSubpages']) {
-                       $status['protectedSection'] = TRUE;
-               }
-               // Hook: allow some other process to influence the choice of icon overlay
-               // The method called receives the table name, the current row and the current status array as parameters
-               // The status array should be passed as a reference and in order to be modified within the hook
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay'] as $classRef) {
-                               $hookObject = GeneralUtility::getUserObj($classRef);
-                               if (method_exists($hookObject, 'overrideIconOverlay')) {
-                                       $hookObject->overrideIconOverlay($table, $row, $status);
-                               }
-                       }
-               }
-               // Now only show the status with the highest priority
-               $priorities = $GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayPriorities'];
-               $iconName = '';
-               if (is_array($priorities)) {
-                       foreach ($priorities as $priority) {
-                               if ($status[$priority]) {
-                                       $iconName = $GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayNames'][$priority];
-                                       break;
-                               }
-                       }
-               }
-
-               return $iconName;
-       }
-
-       /**
         * generic method to create the final CSS classes based on the sprite icon name
         * with the base class and splits the name into parts
         * is usually called by the methods that are responsible for fetching the names
@@ -1017,8 +861,10 @@ class IconUtility {
         *
         * @param string $iconName Iconname like 'actions-document-new'
         * @return string A list of all CSS classes needed for the HTML tag
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
         */
        static public function getSpriteIconClasses($iconName) {
+               GeneralUtility::logDeprecatedFunction();
                $cssClasses = ($baseCssClass = 't3-icon');
                $parts = explode('-', $iconName);
                if (count($parts) > 1) {
@@ -1029,7 +875,6 @@ class IconUtility {
                        // Will be something like "t3-icon-document-new"
                        $cssClasses .= ' ' . ($baseCssClass . '-' . substr($iconName, (strlen($parts[0]) + 1)));
                }
-               static::emitBuildSpriteIconClassesSignal($iconName, $cssClasses);
 
                return $cssClasses;
        }
@@ -1042,10 +887,11 @@ class IconUtility {
         * @param array $tagAttributes An associative array of additional tagAttributes for the HTML tag
         * @param string $innerHtml The content within the tag, a "&nbsp;" by default
         * @param string $tagName The name of the HTML element that should be used (span by default)
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
         * @return string The sprite html icon tag
         */
        static protected function buildSpriteHtmlIconTag(array $tagAttributes, $innerHtml = NULL, $tagName = NULL) {
-               list($tagAttributes, $innerHtml, $tagName) = static::emitBuildSpriteHtmlIconTagSignal($tagAttributes, $innerHtml, $tagName);
+               GeneralUtility::logDeprecatedFunction();
 
                $innerHtml = $innerHtml === NULL ? ' ' : $innerHtml;
                $tagName = $tagName === NULL ? 'span' : $tagName;
@@ -1057,34 +903,4 @@ class IconUtility {
                return '<' . $tagName . $attributes . '>' . $innerHtml . '</' . $tagName . '>';
        }
 
-       /**
-        * @param array $tagAttributes An associative array of additional tagAttributes for the HTML tag
-        * @param string $innerHtml The content within the tag, NULL by default
-        * @param string $tagName The name of the HTML element that should be used (span by default), NULL by default
-        * @return array
-        */
-       static protected function emitBuildSpriteHtmlIconTagSignal(array $tagAttributes, $innerHtml, $tagName) {
-               return static::getSignalSlotDispatcher()->dispatch(\TYPO3\CMS\Backend\Utility\IconUtility::class, 'buildSpriteHtmlIconTag', array($tagAttributes, $innerHtml, $tagName));
-       }
-
-       /**
-        * Emits a signal right after the CSS classes are built. This is useful if somebody only
-        * fetches the CSS classes via IconUtility and not the whole sprite span tag.
-        *
-        * @param string $iconName The name of the icon
-        * @param string $cssClasses the CSS classes to be used as a string
-        */
-       static protected function emitBuildSpriteIconClassesSignal($iconName, &$cssClasses) {
-               static::getSignalSlotDispatcher()->dispatch(\TYPO3\CMS\Backend\Utility\IconUtility::class, 'buildSpriteIconClasses', array($iconName, &$cssClasses));
-       }
-
-       /**
-        * Get the SignalSlot dispatcher
-        *
-        * @return \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
-        */
-       static protected function getSignalSlotDispatcher() {
-               return GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
-       }
-
 }
index eb6f624..c18f99e 100644 (file)
@@ -16,6 +16,8 @@ namespace TYPO3\CMS\Backend\Utility;
 
 /**
  * Interface for classes which hook into IconUtility::getSpriteIconForResource()
+ *
+ * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
  */
 interface IconUtilityOverrideResourceIconHookInterface {
 
@@ -29,7 +31,8 @@ interface IconUtilityOverrideResourceIconHookInterface {
         * @param string $iconName
         * @param array $options
         * @param array $overlays
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
         */
        public function overrideResourceIcon(\TYPO3\CMS\Core\Resource\ResourceInterface $resource, &$iconName, array &$options, array &$overlays);
 
-}
\ No newline at end of file
+}
index af25eff..062e9f6 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\View;
 
 use TYPO3\CMS\Backend\Controller\PageLayoutController;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Imaging\Icon;
index 9486049..c746614 100644 (file)
@@ -261,7 +261,7 @@ define('TYPO3/CMS/Backend/DragUploader', ['jquery', 'moment', 'nprogress', 'TYPO
                                        $('<td />').append(
                                                (askForOverride[i].original.thumbUrl !== ''
                                                        ? $('<img />', {src: askForOverride[i].original.thumbUrl, height: 40})
-                                                       : $('<span />', {class: askForOverride[i].original.iconClasses})
+                                                       : $(askForOverride[i].original.icon)
                                                )
                                        ),
                                        $('<td />').html(
@@ -415,8 +415,8 @@ define('TYPO3/CMS/Backend/DragUploader', ['jquery', 'moment', 'nprogress', 'TYPO
                                me.$progressBar.outerWidth('100%');
 
                                // replace file icon
-                               if (data.result.upload[0].iconClasses) {
-                                       me.$iconCol.html('<a href="#" class="t3-js-clickmenutrigger" data-table="' + data.result.upload[0].id + '" data-listframe="1"><span class="' + data.result.upload[0].iconClasses + '">&nbsp;</span></a>');
+                               if (data.result.upload[0].icon) {
+                                       me.$iconCol.html('<a href="#" class="t3-js-clickmenutrigger" data-table="' + data.result.upload[0].id + '" data-listframe="1">' + data.result.upload[0].icon + '&nbsp;</span></a>');
                                }
 
                                if (me.dragUploader.irreObjectUid) {
index e0f6425..c483913 100644 (file)
@@ -222,9 +222,8 @@ TYPO3.Components.PageTree.App = Ext.extend(Ext.Panel, {
 
                        html: '<p>' +
                                        '<span id="' + this.id + '-indicatorBar-temporaryMountPoint-info' + '" ' +
-                                               'class="' + this.id + '-indicatorBar-item-leftIcon ' +
-                                                       TYPO3.Components.PageTree.Sprites.Info + '">&nbsp;' +
-                                       '</span>' +
+                                               'class="' + this.id + '-indicatorBar-item-leftIcon">' +
+                                                       TYPO3.Components.PageTree.Icons.Info + '</span>' +
                                        '<span id="' + this.id + '-indicatorBar-temporaryMountPoint-clear' + '" ' +
                                                'class="' + this.id + '-indicatorBar-item-rightIcon ' + '">X' +
                                        '</span>' +
index 22107b0..9c6d9fa 100644 (file)
@@ -120,9 +120,7 @@ TYPO3.Components.PageTree.DeletionDropZone = Ext.extend(Ext.Panel, {
         * @return {void}
         */
        initComponent: function() {
-               this.html = '<p><span id="' + this.id + '-icon" class="' +
-                       TYPO3.Components.PageTree.Sprites.TrashCan +
-                       '">&nbsp;</span><span id="' + this.id + '-text">' +
+               this.html = '<p><span id="' + this.id + '-icon">' + TYPO3.Components.PageTree.Icons.TrashCan + '</span><span id="' + this.id + '-text">' +
                        TYPO3.Components.PageTree.LLL.dropToRemove + '</span></p>';
 
                TYPO3.Components.PageTree.DeletionDropZone.superclass.initComponent.apply(this, arguments);
@@ -191,7 +189,7 @@ TYPO3.Components.PageTree.DeletionDropZone = Ext.extend(Ext.Panel, {
 
                this.show();
                this.setHeight(50);
-               this.updateIcon(TYPO3.Components.PageTree.Sprites.TrashCanRestore);
+               this.updateIcon(TYPO3.Components.PageTree.Icons.TrashCanRestore);
                this.updateText(
                        node.text + '<br />' +
                        '<span class="' + this.id + '-restore">' +
@@ -243,15 +241,13 @@ TYPO3.Components.PageTree.DeletionDropZone = Ext.extend(Ext.Panel, {
        },
 
        /**
-        * Updates the drop zone icon with another sprite icon
+        * Updates the drop zone icon with another icon
         *
-        * @param {String} classes
+        * @param {String} icon
         * @return {void}
         */
-       updateIcon: function(classes) {
-               Ext.get(this.id + '-icon').set({
-                       'class': classes
-               });
+       updateIcon: function(icon) {
+               Ext.get(this.id + '-icon').update(icon);
        },
 
        /**
@@ -275,7 +271,7 @@ TYPO3.Components.PageTree.DeletionDropZone = Ext.extend(Ext.Panel, {
 
                this.setHeight(35);
                this.updateText(TYPO3.Components.PageTree.LLL.dropToRemove, false);
-               this.updateIcon(TYPO3.Components.PageTree.Sprites.TrashCan);
+               this.updateIcon(TYPO3.Components.PageTree.Icons.TrashCan);
                this.app.doLayout();
        },
 
index 74e19b1..db418ec 100644 (file)
@@ -252,9 +252,8 @@ TYPO3.Components.PageTree.TopPanel = Ext.extend(Ext.Panel, {
                        cls: this.app.id + '-indicatorBar-item',
                        html: '<p>' +
                                        '<span id="' + this.app.id + '-indicatorBar-filter-info' + '" ' +
-                                               'class="' + this.app.id + '-indicatorBar-item-leftIcon ' +
-                                                       TYPO3.Components.PageTree.Sprites.Info + '">&nbsp;' +
-                                       '</span>' +
+                                               'class="' + this.app.id + '-indicatorBar-item-leftIcon">' +
+                                                       TYPO3.Components.PageTree.Icons.Info + '</span>' +
                                        '<span id="' + this.app.id + '-indicatorBar-filter-clear' + '" ' +
                                                'class="' + this.app.id + '-indicatorBar-item-rightIcon ' + '">X' +
                                        '</span>' +
@@ -293,7 +292,11 @@ TYPO3.Components.PageTree.TopPanel = Ext.extend(Ext.Panel, {
                var textField = new Ext.form.TriggerField({
                        id: this.id + '-filter',
                        enableKeyEvents: true,
-                       triggerClass: TYPO3.Components.PageTree.Sprites.InputClear,
+                       triggerConfig: {
+                               tag: 'span',
+                               html: TYPO3.Components.PageTree.Icons.InputClear,
+                               cls: 't3-icon-input-clear'
+                       },
                        value: TYPO3.Components.PageTree.LLL.searchTermInfo,
 
                        listeners: {
@@ -331,7 +334,7 @@ TYPO3.Components.PageTree.TopPanel = Ext.extend(Ext.Panel, {
                        this.createFilterTree(textField);
                }.createDelegate(this);
 
-               var topPanelWidget = new Ext.Panel({
+               var topPanelWidget = new Ext.Container({
                        border: false,
                        id: this.id + '-filterWrap',
                        cls: this.id + '-item',
@@ -379,11 +382,10 @@ TYPO3.Components.PageTree.TopPanel = Ext.extend(Ext.Panel, {
                        onInitDrag: function() {
                                this.topPanel.app.activeTree.dontSetOverClass = true;
                                var clickedButton = this.dragData.item;
-                               var cls = clickedButton.initialConfig.iconCls;
 
                                this.proxyElement.shadow = false;
                                this.proxyElement.innerHTML = '<div class="x-dd-drag-ghost-pagetree">' +
-                                       '<span class="x-dd-drag-ghost-pagetree-icon ' + cls + '">&nbsp;</span>' +
+                                       '<span class="x-dd-drag-ghost-pagetree-icon">' + clickedButton.initialConfig.html + '</span>' +
                                        '<span class="x-dd-drag-ghost-pagetree-text">'  + clickedButton.title + '</span>' +
                                '</div>';
 
index 2e23871..9af6f37 100644 (file)
@@ -69,15 +69,16 @@ class FileControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
                $this->assertTrue($this->fileController->_call('flattenResultDataValue', TRUE));
                $this->assertSame(array(), $this->fileController->_call('flattenResultDataValue', array()));
-
+               $result = $this->fileController->_call('flattenResultDataValue', $this->fileResourceMock);
+               $this->assertContains('<span class="icon icon-size-small icon-state-default icon-mimetypes-text-html">', $result['icon']);
+               unset($result['icon']);
                $this->assertSame(
                        array(
                                'id' => 'foo',
                                'date' => '29-11-73',
-                               'iconClasses' => 't3-icon t3-icon-mimetypes t3-icon-mimetypes-text t3-icon-text-html',
-                               'thumbUrl' => ''
+                               'thumbUrl' => '',
                        ),
-                       $this->fileController->_call('flattenResultDataValue', $this->fileResourceMock)
+                       $result
                );
 
                $this->assertSame(
@@ -143,29 +144,4 @@ class FileControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->fileController->processAjaxRequest(array(), $this->mockAjaxRequestHandler);
        }
 
-       /**
-        * @test
-        */
-       public function processAjaxRequestUploadProcess() {
-               $this->fileController = $this->getAccessibleMock(\TYPO3\CMS\Backend\Controller\File\FileController::class, array('init', 'main'));
-               $this->mockAjaxRequestHandler = $this->getMock(\TYPO3\CMS\Core\Http\AjaxRequestHandler::class, array('addContent', 'setContentFormat'), array(), '', FALSE);
-
-               $fileData = array('upload' => array(array($this->fileResourceMock)));
-               $result = array('upload' => array(array(
-                       'id' => 'foo',
-                       'date' => '29-11-73',
-                       'iconClasses' => 't3-icon t3-icon-mimetypes t3-icon-mimetypes-text t3-icon-text-html',
-                       'thumbUrl' => ''
-               )));
-               $this->fileController->_set('fileProcessor', $this->mockFileProcessor);
-               $this->fileController->_set('fileData', $fileData);
-               $this->fileController->_set('redirect', FALSE);
-
-               $this->fileController->expects($this->once())->method('main');
-               $this->mockAjaxRequestHandler->expects($this->once())->method('addContent')->with('result', $result);
-               $this->mockAjaxRequestHandler->expects($this->once())->method('setContentFormat')->with('json');
-
-               $this->fileController->processAjaxRequest(array(), $this->mockAjaxRequestHandler);
-       }
-
 }
index 079b0fa..d4ca1d2 100644 (file)
@@ -272,7 +272,7 @@ class TcaSelectItemsTest extends UnitTestCase {
                        0 => [
                                0 => 'aTitle',
                                1 => 'aTable',
-                               2 => 'status-status-icon-missing',
+                               2 => 'default-not-found',
                                3 => [
                                        'description' => 'aDescription',
                                ],
@@ -333,7 +333,7 @@ class TcaSelectItemsTest extends UnitTestCase {
                        0 => [
                                0 => 'aLabel',
                                1 => 'aValue',
-                               2 => 'status-status-icon-missing',
+                               2 => 'default-not-found',
                                3 => NULL,
                        ]
                ];
@@ -369,7 +369,7 @@ class TcaSelectItemsTest extends UnitTestCase {
                                        0 => [
                                                0 => 'fooTableTitle',
                                                1 => '--div--',
-                                               2 => 'status-status-icon-missing',
+                                               2 => 'default-not-found',
                                                3 => NULL,
                                        ],
                                        1 => [
@@ -404,7 +404,7 @@ class TcaSelectItemsTest extends UnitTestCase {
                                        0 => [
                                                0 => 'fooTableTitle',
                                                1 => '--div--',
-                                               2 => 'status-status-icon-missing',
+                                               2 => 'default-not-found',
                                                3 => NULL,
                                        ],
                                        1 => [
@@ -560,7 +560,7 @@ class TcaSelectItemsTest extends UnitTestCase {
                        0 => [
                                0 => 'fooTableTitle',
                                1 => '--div--',
-                               2 => 'status-status-icon-missing',
+                               2 => 'default-not-found',
                                3 => NULL,
                        ],
                        1 => [
@@ -1514,13 +1514,13 @@ class TcaSelectItemsTest extends UnitTestCase {
                        0 => [
                                0 => 'aPrefix[LLL:EXT:lang/locallang_core.xlf:labels.no_title]',
                                1 => 1,
-                               2 => 'status-status-icon-missing',
+                               2 => 'default-not-found',
                                3 => NULL,
                        ],
                        1 => [
                                0 => 'aPrefix[LLL:EXT:lang/locallang_core.xlf:labels.no_title]',
                                1 => 2,
-                               2 => 'status-status-icon-missing',
+                               2 => 'default-not-found',
                                3 => NULL,
                        ],
                ];
index b9baa64..9e74d24 100644 (file)
@@ -147,573 +147,4 @@ class IconUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                sort($result);
                $this->assertEquals(array('t3-icon', 't3-icon-actions', 't3-icon-actions-juggle', 't3-icon-juggle-speed-game'), $result);
        }
-
-       //////////////////////////////////////////
-       // Tests concerning getSpriteIcon
-       //////////////////////////////////////////
-       /**
-        * Tests whether an empty string returns a span with the missing sprite
-        *
-        * @test
-        */
-       public function getSpriteIconWithEmptyStringReturnsSpanWithIconMissingSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                               ),
-                       ),
-               );
-               $this->assertEquals('<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"> </span>', IconUtilityFixture::getSpriteIcon(''));
-       }
-
-       /**
-        * Tests whether an non existing icons returns a span with the missing sprite
-        *
-        * @test
-        */
-       public function getSpriteIconWithMissingIconReturnsSpanWithIconMissingSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                               ),
-                       ),
-               );
-               $this->assertEquals('<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"> </span>', IconUtilityFixture::getSpriteIcon('actions-juggle-speed'));
-       }
-
-       /**
-        * Tests whether an existing icon returns a span with the correct sprite
-        *
-        * @test
-        */
-       public function getSpriteIconWithExistingIconReturnsSpanWithIconSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'actions-document-new',
-                               ),
-                       ),
-               );
-               $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new"> </span>', IconUtilityFixture::getSpriteIcon('actions-document-new'));
-       }
-
-       /**
-        * Tests the returns of an existing icon + an other attribute like title="foo"
-        *
-        * @test
-        */
-       public function getSpriteIconWithExistingIconAndAttributeReturnsSpanWithIconSpriteAndAttribute() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'actions-document-new',
-                               ),
-                       ),
-               );
-               $this->assertEquals('<span title="foo" class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new"> </span>', IconUtilityFixture::getSpriteIcon('actions-document-new', array('title' => 'foo')));
-       }
-
-       /**
-        * Tests the returns of an existing icon + a class attribute
-        *
-        * @test
-        */
-       public function getSpriteIconWithExistingIconAndClassAttributeReturnsSpanWithIconSpriteAndClassAttribute() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'actions-document-new',
-                               ),
-                       ),
-               );
-               $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new foo"> </span>', IconUtilityFixture::getSpriteIcon('actions-document-new', array('class' => 'foo')));
-       }
-
-       /**
-        * Tests the returns of an existing icon + a class attribute
-        *
-        * @test
-        */
-       public function getSpriteIconWithExistingIconAndInnerHTMLReturnsSpanWithIconSpriteAndInnerHTML() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'actions-document-new',
-                               ),
-                       ),
-               );
-               $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">foo</span>', IconUtilityFixture::getSpriteIcon('actions-document-new', array('html' => 'foo')));
-       }
-
-       /**
-        * Tests the returns of an existing icon + an overlay
-        *
-        * @test
-        */
-       public function getSpriteIconWithExistingIconAndOverlayReturnsSpanWithIconSpriteAndOverlay() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'actions-document-new',
-                                       'status-overlay-hidden',
-                               ),
-                       ),
-               );
-               $result = IconUtilityFixture::getSpriteIcon('actions-document-new', array(), array('status-overlay-hidden' => array()));
-               $overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay"> </span>';
-               $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">' . $overlay . '</span>', $result);
-       }
-
-       /**
-        * Tests the returns of an existing icon + an overlay
-        *
-        * @test
-        */
-       public function getSpriteIconWithExistingIconAndOverlayAndAttributesReturnsSpanWithIconSpriteAndOverlayAndAttributes() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'actions-document-new',
-                                       'status-overlay-hidden',
-                               ),
-                       ),
-               );
-               $result = IconUtilityFixture::getSpriteIcon('actions-document-new', array('html' => 'foo1'), array('status-overlay-hidden' => array('class' => 'foo2')));
-               $overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden foo2 t3-icon-overlay">foo1</span>';
-               $this->assertEquals('<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new">' . $overlay . '</span>', $result);
-       }
-
-       //////////////////////////////////////////
-       // Tests concerning getSpriteIconForRecord
-       //////////////////////////////////////////
-       /**
-        * Tests the returns of NULL table + empty array
-        *
-        * @test
-        */
-       public function getSpriteIconForRecordWithNullTableReturnsMissingIcon() {
-               $result = IconUtilityFixture::getSpriteIconForRecord('', array());
-               $this->assertEquals('<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of tt_content + empty record
-        *
-        * @test
-        */
-       public function getSpriteIconForRecordWithEmptyRecordReturnsNormalSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array('mimetypes-x-content-text'),
-                       ),
-               );
-               $GLOBALS['TCA'] = array(
-                       'tt_content' => array(
-                               'ctrl' => array(
-                                       'typeicon_column' => 'CType',
-                                       'typeicon_classes' => array(
-                                               'default' => 'mimetypes-x-content-text',
-                                       ),
-                               ),
-                       ),
-               );
-               $result = IconUtilityFixture::getSpriteIconForRecord('tt_content', array());
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of tt_content + mock record
-        *
-        * @test
-        */
-       public function getSpriteIconForRecordWithMockRecordReturnsNormalSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array('mimetypes-x-content-text'),
-                       ),
-               );
-               $GLOBALS['TCA'] = array(
-                       'tt_content' => array(
-                               'ctrl' => array(
-                                       'typeicon_column' => 'CType',
-                                       'typeicon_classes' => array(
-                                               'text' => 'mimetypes-x-content-text',
-                                       ),
-                               ),
-                       ),
-               );
-               $result = IconUtilityFixture::getSpriteIconForRecord('tt_content', $this->mockRecord);
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of tt_content + mock record + options
-        *
-        * @test
-        */
-       public function getSpriteIconForRecordWithMockRecordAndOptionsReturnsNormalSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array('mimetypes-x-content-text'),
-                       ),
-               );
-               $GLOBALS['TCA'] = array(
-                       'tt_content' => array(
-                               'ctrl' => array(
-                                       'typeicon_column' => 'CType',
-                                       'typeicon_classes' => array(
-                                               'text' => 'mimetypes-x-content-text',
-                                       ),
-                               ),
-                       ),
-               );
-               $result = IconUtilityFixture::getSpriteIconForRecord('tt_content', $this->mockRecord, array('class' => 'foo', 'title' => 'bar'));
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text foo" title="bar"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of tt_content + mock record of type 'list' (aka plugin)
-        *
-        * @test
-        */
-       public function getSpriteIconForRecordWithMockRecordOfTypePluginReturnsPluginSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array('mimetypes-x-content-plugin'),
-                       ),
-               );
-               $GLOBALS['TCA'] = array(
-                       'tt_content' => array(
-                               'ctrl' => array(
-                                       'typeicon_column' => 'CType',
-                                       'typeicon_classes' => array(
-                                               'list' => 'mimetypes-x-content-plugin',
-                                       ),
-                               ),
-                       ),
-               );
-               $mockRecord = $this->mockRecord;
-               $mockRecord['CType'] = 'list';
-               $result = IconUtilityFixture::getSpriteIconForRecord('tt_content', $mockRecord);
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-plugin"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of tt_content + mock record with hidden flag
-        *
-        * @test
-        */
-       public function getSpriteIconForRecordWithMockRecordWithHiddenFlagReturnsNormalSpriteAndOverlay() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'mimetypes-x-content-text',
-                                       'status-overlay-hidden',
-                               ),
-                               'spriteIconRecordOverlayNames' => array(
-                                       'hidden' => 'status-overlay-hidden',
-                               ),
-                               'spriteIconRecordOverlayPriorities' => array(
-                                       'hidden'
-                               ),
-                       ),
-               );
-               $GLOBALS['TCA'] = array(
-                       'tt_content' => array(
-                               'ctrl' => array(
-                                       'enablecolumns' => array(
-                                               'disabled' => 'hidden',
-                                       ),
-                                       'typeicon_column' => 'CType',
-                                       'typeicon_classes' => array(
-                                               'text' => 'mimetypes-x-content-text',
-                                       ),
-                               ),
-                       ),
-               );
-               $mockRecord = $this->mockRecord;
-               $mockRecord['hidden'] = '1';
-               $result = IconUtilityFixture::getSpriteIconForRecord('tt_content', $mockRecord);
-               $overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay"> </span>';
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-content-text">' . $overlay . '</span>', $result);
-       }
-
-       //////////////////////////////////////////
-       // Tests concerning getSpriteIconForFile
-       //////////////////////////////////////////
-       /**
-        * Tests the returns of no file
-        *
-        * @test
-        */
-       public function getSpriteIconForFileWithNoFileTypeReturnsOtherSprite() {
-               $result = IconUtilityFixture::getSpriteIconForFile('');
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of unknown file
-        *
-        * @test
-        */
-       public function getSpriteIconForFileWithNoUnknowFileTypeReturnsOtherSprite() {
-               $result = IconUtilityFixture::getSpriteIconForFile('foo');
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of file pdf
-        *
-        * @test
-        */
-       public function getSpriteIconForFileWithPdfReturnsPdfSprite() {
-               $result = IconUtilityFixture::getSpriteIconForFile('pdf');
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-pdf t3-icon-pdf"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of file png
-        *
-        * @test
-        */
-       public function getSpriteIconForFileWithPngReturnsPngSprite() {
-               $result = IconUtilityFixture::getSpriteIconForFile('png');
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of file png + option
-        *
-        * @test
-        */
-       public function getSpriteIconForFileWithPngAndOptionsReturnsPngSpriteAndOptions() {
-               $result = IconUtilityFixture::getSpriteIconForFile('png', array('title' => 'bar'));
-               $this->assertEquals('<span title="bar" class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"> </span>', $result);
-       }
-
-       /**
-        * Tests whether an overrideIconOverlay hook is called.
-        *
-        * @test
-        */
-       public function isOverrideIconOverlayHookCalled() {
-               $classReference = $this->getUniqueId('user_overrideIconOverlayHook');
-               $hookMock = $this->getMock($classReference, array('overrideIconOverlay'), array());
-               $hookMock->expects($this->once())->method('overrideIconOverlay');
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay'][$classReference] = $classReference;
-               $GLOBALS['T3_VAR']['getUserObj'][$classReference] = $hookMock;
-               IconUtilityFixture::mapRecordOverlayToSpriteIconName('tt_content', array());
-       }
-
-       /**
-        * Tests whether a faulty overrideIconOverlay hook (the hook object cannot be found) is not called.
-        *
-        * @test
-        */
-       public function isFaultyOverrideIconOverlayHookNotCalled() {
-               $classReference = $this->getUniqueId('user_overrideIconOverlayHook');
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay'][$classReference] = $classReference;
-               $GLOBALS['T3_VAR']['getUserObj'][$classReference] = new \stdClass();
-               IconUtilityFixture::mapRecordOverlayToSpriteIconName('tt_content', array());
-       }
-
-       //////////////////////////////////////////////
-       // Tests concerning getSpriteIconForResource
-       //////////////////////////////////////////////
-       /**
-        * Tests the returns of no file
-        *
-        * @test
-        */
-       public function getSpriteIconForResourceWithFileWithoutExtensionTypeReturnsOtherSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'mimetypes-other-other',
-                               ),
-                       ),
-               );
-               $fileObject = $this->getTestSubjectFileObject('');
-               $result = IconUtilityFixture::getSpriteIconForResource($fileObject);
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of unknown file
-        *
-        * @test
-        */
-       public function getSpriteIconForResourceWithUnknownFileTypeReturnsOtherSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'mimetypes-other-other',
-                               ),
-                       ),
-               );
-               $fileObject = $this->getTestSubjectFileObject('foo');
-               $result = IconUtilityFixture::getSpriteIconForResource($fileObject);
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-other t3-icon-other-other"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of file pdf
-        *
-        * @test
-        */
-       public function getSpriteIconForResourceWithPdfReturnsPdfSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'mimetypes-pdf',
-                               ),
-                       ),
-               );
-               $fileObject = $this->getTestSubjectFileObject('pdf');
-               $result = IconUtilityFixture::getSpriteIconForResource($fileObject);
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-pdf t3-icon-pdf"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of file png
-        *
-        * @test
-        */
-       public function getSpriteIconForResourceWithPngFileReturnsPngSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'mimetypes-media-image',
-                               ),
-                       ),
-               );
-               $fileObject = $this->getTestSubjectFileObject('png');
-               $result = IconUtilityFixture::getSpriteIconForResource($fileObject);
-               $this->assertEquals('<span class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of file png + option
-        *
-        * @test
-        */
-       public function getSpriteIconForResourceWithPngFileAndOptionsReturnsPngSpriteAndOptions() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'mimetypes-media-image',
-                               ),
-                       ),
-               );
-               $fileObject = $this->getTestSubjectFileObject('png');
-               $result = IconUtilityFixture::getSpriteIconForResource($fileObject, array('title' => 'bar'));
-               $this->assertEquals('<span title="bar" class="t3-icon t3-icon-mimetypes t3-icon-mimetypes-media t3-icon-media-image"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of normal folder
-        *
-        * @test
-        */
-       public function getSpriteIconForResourceWithFolderReturnsFolderSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'apps-filetree-folder-default',
-                               ),
-                       ),
-               );
-               $folderObject = $this->getTestSubjectFolderObject('/test');
-               $result = IconUtilityFixture::getSpriteIconForResource($folderObject);
-               $this->assertEquals('<span class="t3-icon t3-icon-apps t3-icon-apps-filetree t3-icon-filetree-folder-default"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of open folder
-        *
-        * @test
-        */
-       public function getSpriteIconForResourceWithOpenFolderReturnsOpenFolderSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'apps-filetree-folder-opened',
-                               ),
-                       ),
-               );
-               $folderObject = $this->getTestSubjectFolderObject('/test');
-               $result = IconUtilityFixture::getSpriteIconForResource($folderObject, array('folder-open' => TRUE));
-               $this->assertEquals('<span class="t3-icon t3-icon-apps t3-icon-apps-filetree t3-icon-filetree-folder-opened"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of root folder
-        *
-        * @test
-        */
-       public function getSpriteIconForResourceWithRootFolderReturnsRootFolderSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'apps-filetree-root',
-                               ),
-                       ),
-               );
-               $folderObject = $this->getTestSubjectFolderObject('/');
-               $result = IconUtilityFixture::getSpriteIconForResource($folderObject);
-               $this->assertEquals('<span class="t3-icon t3-icon-apps t3-icon-apps-filetree t3-icon-filetree-root"> </span>', $result);
-       }
-
-       /**
-        * Tests the returns of mount root
-        *
-        * @test
-        */
-       public function getSpriteIconForResourceWithMountRootReturnsMountFolderSprite() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array(
-                                       'apps-filetree-mount',
-                               ),
-                       ),
-               );
-               $folderObject = $this->getTestSubjectFolderObject('/mount');
-               $result = IconUtilityFixture::getSpriteIconForResource($folderObject, array('mount-root' => TRUE));
-               $this->assertEquals('<span class="t3-icon t3-icon-apps t3-icon-apps-filetree t3-icon-filetree-mount"> </span>', $result);
-       }
-
-       /**
-        * Tests whether an overrideResourceIcon hook is called.
-        *
-        * @test
-        */
-       public function isOverrideResourceIconHookCalled() {
-               $GLOBALS['TBE_STYLES'] = array(
-                       'spriteIconApi' => array(
-                               'iconsAvailable' => array()
-                       ),
-               );
-               $classReference = $this->getUniqueId('user_overrideResourceIconHook');
-               $folderObject = $this->getTestSubjectFolderObject('/test');
-               $hookMock = $this->getMock(\TYPO3\CMS\Backend\Utility\IconUtilityOverrideResourceIconHookInterface::class, array('overrideResourceIcon'), array(), $classReference);
-               $hookMock->expects($this->once())->method('overrideResourceIcon');
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideResourceIcon'][$classReference] = $classReference;
-               $GLOBALS['T3_VAR']['getUserObj'][$classReference] = $hookMock;
-               IconUtilityFixture::getSpriteIconForResource($folderObject);
-       }
-
-       /**
-        * Tests whether a faulty overrideResourceIcon hook (the hook object cannot be found) is not called.
-        *
-        * @test
-        * @expectedException \UnexpectedValueException
-        */
-       public function isFaultyResourceIconHookNotCalled() {
-               $classReference = $this->getUniqueId('user_overrideResourceIconHook');
-               $folderObject = $this->getTestSubjectFolderObject('/test');
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideResourceIcon'][$classReference] = $classReference;
-               $GLOBALS['T3_VAR']['getUserObj'][$classReference] = new \stdClass();
-               IconUtilityFixture::getSpriteIconForResource($folderObject);
-       }
-
 }
index 1edb0aa..c1a37fb 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Belog\ViewHelpers;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Belog\Domain\Model\HistoryEntry;
 use TYPO3\CMS\Belog\Domain\Repository\HistoryEntryRepository;
 use TYPO3\CMS\Core\Imaging\Icon;
index a2c9cac..b4545fb 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Beuser\Controller;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Core\Http\AjaxRequestHandler;
 use TYPO3\CMS\Core\Imaging\Icon;
index 3d44920..0a675d7 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Beuser\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Beuser\Domain\Model\BackendUser;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Imaging\Icon;
@@ -25,7 +24,6 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
-use TYPO3\CMS\Lang\LanguageService;
 
 /**
  * Displays 'Delete user' link with sprite icon to remove user
index 15a3140..a058c49 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Beuser\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Beuser\Domain\Model\BackendUser;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
index 7e9ed29..70bad51 100644 (file)
@@ -36,7 +36,7 @@ class TcaMigration implements TableConfigurationPostProcessingHookInterface {
                $GLOBALS['TCA'] = $tcaMigration->migrate($GLOBALS['TCA']);
                $messages = $tcaMigration->getMessages();
                if (!empty($messages)) {
-                       $context = 'ext:compatibility6 did an automatic migration of TCA during boostrap. This costs performance on every'
+                       $context = 'ext:compatibility6 did an automatic migration of TCA during bootstrap. This costs performance on every'
                                . ' call. It also means some old extensions register TCA in ext_tables.php and not in Configuration/TCA.'
                                . ' Please adapt TCA accordingly until this message is not thrown anymore and unload extension compatibility6'
                                . ' as soon as possible';
index 932f7b5..29e03cc 100644 (file)
@@ -1200,7 +1200,6 @@ return array(
        'tx_version_cm1' => \TYPO3\CMS\Version\Controller\VersionModuleController::class,
        'tx_version_tcemain_CommandMap' => \TYPO3\CMS\Version\DataHandler\CommandMap::class,
        'tx_version_tcemain' => \TYPO3\CMS\Version\Hook\DataHandlerHook::class,
-       'tx_version_iconworks' => \TYPO3\CMS\Version\Hook\IconUtilityHook::class,
        'Tx_Version_Preview' => \TYPO3\CMS\Version\Hook\PreviewHook::class,
        'tx_version_tasks_AutoPublish' => \TYPO3\CMS\Version\Task\AutoPublishTask::class,
        't3lib_utility_Dependency_Factory' => \TYPO3\CMS\Version\Dependency\DependencyEntityFactory::class,
index befc943..1691aac 100644 (file)
@@ -5964,11 +5964,6 @@ class tx_version_tcemain extends \TYPO3\CMS\Version\Hook\DataHandlerHook {}
 /**
  * @deprecated since 6.0, removed since 7.0
  */
-class tx_version_iconworks extends \TYPO3\CMS\Version\Hook\IconUtilityHook {}
-
-/**
- * @deprecated since 6.0, removed since 7.0
- */
 class tx_version_tasks_AutoPublish extends \TYPO3\CMS\Version\Task\AutoPublishTask {}
 
 /**
index a3c0afb..a16dbbe 100644 (file)
@@ -209,9 +209,11 @@ class IconFactory {
         *
         * @param string $table The TCA table
         * @param array $row The selected record
+        * @internal
+        * @TODO: make this method protected, after FormEngine doesn't need it anymore.
         * @return string The icon identifier string for the icon of that DB record
         */
-       protected function mapRecordTypeToIconIdentifier($table, array $row) {
+       public function mapRecordTypeToIconIdentifier($table, array $row) {
                $recordType = array();
                $ref = NULL;
 
index 3d39c7d..51d1a1a 100644 (file)
@@ -618,6 +618,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'source' => 'EXT:backend/Resources/Public/Icons/Action/actions-filter.svg',
                        )
                ),
+               'actions-input-clear' => array(
+                       'provider' => FontawesomeIconProvider::class,
+                       'options' => array(
+                               'name' => 'times-circle',
+                       )
+               ),
                'actions-insert-record' => array(
                        'provider' => BitmapIconProvider::class,
                        'options' => array(
@@ -998,6 +1004,12 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                'source' => 'EXT:t3skin/images/icons/status/user-group-frontend.png'
                        )
                ),
+               'status-dialog-information' => array(
+                       'provider' => FontawesomeIconProvider::class,
+                       'options' => array(
+                               'name' => 'exclamation-circle'
+                       )
+               ),
                'status-dialog-ok' => array(
                        'provider' => FontawesomeIconProvider::class,
                        'options' => array(
@@ -1806,17 +1818,41 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
         */
        protected function registerFlags() {
                $iconFolder = 'EXT:core/Resources/Public/Icons/Flags/SVG/';
-               $files = scandir(GeneralUtility::getFileAbsFileName($iconFolder));
+               $files = array(
+                       'AC', 'AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ',
+                       'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BM', 'BN', 'BO', 'BR', 'BS', 'BT', 'BW', 'BY', 'BZ',
+                       'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ',
+                       'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'EU',
+                       'FI', 'FJ', 'FK', 'FM', 'FO', 'FR',
+                       'GA', 'GB-ENG', 'GB-NIR', 'GB-SCT', 'GB-WLS', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY',
+                       'HK', 'HN', 'HR', 'HT', 'HU',
+                       'IC', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT',
+                       'JE', 'JM', 'JO', 'JP',
+                       'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ',
+                       'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY',
+                       'MA', 'MC', 'MD', 'ME', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ',
+                       'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ',
+                       'OM',
+                       'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY',
+                       'QA',
+                       'RE', 'RO', 'RS', 'RU', 'RW',
+                       'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ',
+                       'TA', 'TC', 'TD', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ',
+                       'UA', 'UG', 'US-AK', 'US-AL', 'US-AR', 'US-AZ', 'US-CA', 'US-CO', 'US-CT', 'US-DE', 'US-FL', 'US-GA', 'US-HI', 'US-IA', 'US-ID', 'US-IL', 'US-IN', 'US-KS', 'US-KY', 'US-LA', 'US-MA', 'US-MD', 'US-ME', 'US-MI', 'US-MN', 'US-MO', 'US-MS', 'US-MT', 'US-NC', 'US-ND', 'US-NE', 'US-NH', 'US-NJ', 'US-NM', 'US-NV', 'US-NY', 'US-OH', 'US-OK', 'US-OR', 'US-PA', 'US-RI', 'US-SC', 'US-SD', 'US-TN', 'US-TX', 'US-UT', 'US-VA', 'US-VT', 'US-WA', 'US-WI', 'US-WV', 'US-WY', 'US', 'UY', 'UZ',
+                       'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU',
+                       'WF', 'WS',
+                       'XK',
+                       'YE', 'YT',
+                       'ZA', 'ZM', 'ZW'
+               );
                foreach ($files as $file) {
-                       if (!StringUtility::beginsWith($file, '.')) {
-                               $identifier = strtolower(str_replace('.svg', '', $file));
-                               $this->icons['flags-' . $identifier] = array(
-                                       'provider' => SvgIconProvider::class,
-                                       'options' => array(
-                                               'source' => $iconFolder . $file
-                                       )
-                               );
-                       }
+                       $identifier = strtolower($file);
+                       $this->icons['flags-' . $identifier] = array(
+                               'provider' => SvgIconProvider::class,
+                               'options' => array(
+                                       'source' => $iconFolder . $file . '.svg'
+                               )
+                       );
                }
                $this->flagsInitialized = TRUE;
        }
index eb797f4..dc26224 100644 (file)
@@ -420,16 +420,16 @@ class TcaMigration {
                                        foreach ($fieldConfig['config']['items'] as &$itemConfig) {
                                                // more then two values? then the third entry is the image path
                                                if (!empty($itemConfig[2])) {
+                                                       $tcaPath = implode('.', [$table, 'columns', $fieldName, 'config', 'items']);
+                                                       $pathParts = GeneralUtility::trimExplode('/', $itemConfig[2]);
+                                                       // remove first element (ext or sysext)
+                                                       array_shift($pathParts);
+                                                       $path = implode('/', $pathParts);
                                                        // If the path starts with ext/ or sysext/ migrate it
                                                        if (
                                                                StringUtility::beginsWith($itemConfig[2], 'ext/')
                                                                || StringUtility::beginsWith($itemConfig[2], 'sysext/')
                                                        ) {
-                                                               $tcaPath = implode('.', [$table, 'columns', $fieldName, 'config', 'items']);
-                                                               $pathParts = GeneralUtility::trimExplode('/', $itemConfig[2]);
-                                                               // remove first element (ext or sysext)
-                                                               array_shift($pathParts);
-                                                               $path = implode('/', $pathParts);
                                                                $this->messages[] = '[' . $tcaPath . '] ext/ or sysext/ within the path (' . $path . ') in items array is deprecated, use EXT: reference';
                                                                $itemConfig[2] = 'EXT:' . $path;
                                                        } elseif (StringUtility::beginsWith($itemConfig[2], 'i/')) {
index 3241c62..d09b0d1 100644 (file)
@@ -15,6 +15,8 @@ namespace TYPO3\CMS\Core\Tree\TableConfiguration;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -248,7 +250,8 @@ class DatabaseTreeDataProvider extends AbstractTableConfigurationTreeDataProvide
                $node->setId($basicNode->getId());
                $node->setSelectable(!GeneralUtility::inList($this->getNonSelectableLevelList(), $level) && !in_array($basicNode->getId(), $this->getItemUnselectableList()));
                $node->setSortValue($this->nodeSortValues[$basicNode->getId()]);
-               $node->setIcon(\TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($this->tableName, $row));
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+               $node->setIcon($iconFactory->getIconForRecord($this->tableName, $row, Icon::SIZE_SMALL));
                $node->setParentNode($parent);
                if ($basicNode->hasChildNodes()) {
                        $node->setHasChildren(TRUE);
index f530623..c98a58c 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Core\TypoScript;
 
 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\Utility\GeneralUtility;
index c82109f..47f8a45 100644 (file)
@@ -1732,7 +1732,7 @@ tt_content.' . $key . $suffix . ' {
                $GLOBALS['TCA'] = $tcaMigration->migrate($GLOBALS['TCA']);
                $messages = $tcaMigration->getMessages();
                if (!empty($messages)) {
-                       $context = 'Automatic TCA migration done during boostrap. Please adapt TCA accordingly, these migrations'
+                       $context = 'Automatic TCA migration done during bootstrap. Please adapt TCA accordingly, these migrations'
                                . ' will be removed with TYPO3 CMS 8. The backend module "Configuration -> TCA" shows the modified values.'
                                . ' Please adapt these areas:';
                        array_unshift($messages, $context);
index ab891bc..23a4b36 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Core\Utility\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\Messaging\FlashMessage;
index 12322d0..56a95bc 100644 (file)
@@ -77,12 +77,12 @@ return array(
                                        array(
                                                'LLL:EXT:lang/locallang_tca.xlf:doktype.I.0',
                                                (string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT,
-                                               'i/pages.gif'
+                                               'EXT:t3skin/icons/gfx/i/pages.gif'
                                        ),
                                        array(
                                                'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.doktype.I.4',
                                                (string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_BE_USER_SECTION,
-                                               'i/be_users_section.gif'
+                                               'EXT:t3skin/icons/gfx/i/be_users_section.gif'
                                        ),
                                        array(
                                                'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.doktype.div.link',
@@ -91,17 +91,17 @@ return array(
                                        array(
                                                'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.doktype.I.2',
                                                (string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SHORTCUT,
-                                               'i/pages_shortcut.gif'
+                                               'EXT:t3skin/icons/gfx/i/pages_shortcut.gif'
                                        ),
                                        array(
                                                'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.doktype.I.5',
                                                (string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_MOUNTPOINT,
-                                               'i/pages_mountpoint.gif'
+                                               'EXT:t3skin/icons/gfx/i/pages_mountpoint.gif'
                                        ),
                                        array(
                                                'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.doktype.I.8',
                                                (string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_LINK,
-                                               'i/pages_link.gif'
+                                               'EXT:t3skin/icons/gfx/i/pages_link.gif'
                                        ),
                                        array(
                                                'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.doktype.div.special',
@@ -110,17 +110,17 @@ return array(
                                        array(
                                                'LLL:EXT:lang/locallang_tca.xlf:doktype.I.folder',
                                                (string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SYSFOLDER,
-                                               'i/sysf.gif'
+                                               'EXT:t3skin/icons/gfx/i/sysf.gif'
                                        ),
                                        array(
                                                'LLL:EXT:lang/locallang_tca.xlf:doktype.I.2',
                                                (string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_RECYCLER,
-                                               'i/recycler.gif'
+                                               'EXT:t3skin/icons/gfx/i/recycler.gif'
                                        ),
                                        array(
                                                'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.doktype.I.7',
                                                (string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SPACER,
-                                               'i/spacer_icon.gif'
+                                               'EXT:t3skin/icons/gfx/i/spacer_icon.gif'
                                        )
                                ),
                                'default' => (string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT,
@@ -719,7 +719,7 @@ return array(
                                        array(
                                                'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.module.I.4',
                                                'fe_users',
-                                               'i/fe_users.gif'
+                                               'EXT:t3skin/icons/gfx/i/fe_users.gif'
                                        )
                                ),
                                'default' => '',
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-69057-DeprecateIconUtilityAndMoveMethodsIntoIconFactory.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-69057-DeprecateIconUtilityAndMoveMethodsIntoIconFactory.rst
new file mode 100644 (file)
index 0000000..14ed10c
--- /dev/null
@@ -0,0 +1,34 @@
+==========================================================================
+Breaking: #69057 - Deprecate IconUtility and move methods into IconFactory
+==========================================================================
+
+Description
+===========
+
+While refactoring the ``IconUtility`` to the new ``IconFactory`` class, several methods have been marked as deprecated.
+In some cases parameters of the old ``IconUtility`` methods are not used anymore.
+The following list describes the possible breaking changes.
+
+The second parameter $options of method ``IconUtility::getSpriteIconForFile()`` is not used anymore.
+The third parameter $options of method ``IconUtility::getSpriteIconForRecord()`` is not used anymore.
+
+The ``IconUtility`` signals ``buildSpriteIconClasses`` and ``buildSpriteHtmlIconTag`` are dropped and will not be emitted anymore.
+The ``IconUtility`` hook ``$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay']`` is dropped and will not be called anymore.
+
+
+Impact
+======
+
+Extensions could break if the methods, signals or hooks above are used.
+
+
+Affected Installations
+======================
+
+Extensions that call the methods with the $options parameter or make use of the signals and hook.
+
+
+Migration
+=========
+
+Make use of the new ``IconFactory`` class.
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-69057-DeprecateIconUtilityAndMoveMethodsIntoIconFactory.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-69057-DeprecateIconUtilityAndMoveMethodsIntoIconFactory.rst
new file mode 100644 (file)
index 0000000..a32ef08
--- /dev/null
@@ -0,0 +1,42 @@
+=============================================================================
+Deprecation: #69057 - Deprecate IconUtility and move methods into IconFactory
+=============================================================================
+
+Description
+===========
+
+The ``IconUtility`` class will be removed with TYPO3 CMS 8. All public methods of this class have been marked as deprecated:
+
+* ``IconUtility::skinImg()``
+* ``IconUtility::getIcon()``
+* ``IconUtility::getSpriteIcon()``
+* ``IconUtility::getSpriteIconForFile()``
+* ``IconUtility::getSpriteIconForRecord()``
+* ``IconUtility::getSpriteIconForResource()``
+* ``IconUtility::getSpriteIconClasses()``
+
+The PageTS-Config: ``mod.wizards.newContentElement.wizardItems.*.elements.*.icon`` also has been marked as deprecated.
+
+The ``IconUtilityOverrideResourceIconHookInterface`` interface will be removed with TYPO3 CMS 8.
+
+
+Impact
+======
+
+Any usage of these methods will trigger a deprecation log entry.
+
+
+Affected Installations
+======================
+
+Extensions that call these PHP methods directly.
+Extensions that register own content elements with an icon for the new content element wizard.
+
+
+Migration
+=========
+
+Use the new ``IconFactory`` class instead of ``IconUtility``.
+
+For content element wizard register your icon in ``IconRegistry::registerIcon()`` and use the new setting:
+``mod.wizards.newContentElement.wizardItems.*.elements.*.iconIdentifier``
index e5393e1..6d310df 100644 (file)
@@ -51,6 +51,28 @@ class IconFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        protected $iconRegistryMock;
 
        /**
+        * @var array Simulate a tt_content record
+        */
+       protected $mockRecord = array(
+               'header' => 'dummy content header',
+               'uid' => '1',
+               'pid' => '1',
+               'image' => '',
+               'hidden' => '0',
+               'starttime' => '0',
+               'endtime' => '0',
+               'fe_group' => '',
+               'CType' => 'text',
+               't3ver_id' => '0',
+               't3ver_state' => '0',
+               't3ver_wsid' => '0',
+               'sys_language_uid' => '0',
+               'l18n_parent' => '0',
+               'subheader' => '',
+               'bodytext' => '',
+       );
+
+       /**
         * Set up
         *
         * @return void
@@ -254,7 +276,7 @@ class IconFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         *
         * @test
         */
-       public function getIconForFileWithFileTypePdfReturnsPdfSprite() {
+       public function getIconForFileWithFileTypePdfReturnsPdfIcon() {
                $this->assertContains('<span class="icon icon-size-default icon-state-default icon-mimetypes-pdf">',
                        $this->subject->getIconForFileExtension('pdf')->render());
        }
@@ -264,7 +286,7 @@ class IconFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         *
         * @test
         */
-       public function getIconForFileWithFileTypePngReturnsPngSprite() {
+       public function getIconForFileWithFileTypePngReturnsPngIcon() {
                $this->assertContains('<span class="icon icon-size-default icon-state-default icon-mimetypes-media-image">',
                        $this->subject->getIconForFileExtension('png')->render());
        }
@@ -281,9 +303,217 @@ class IconFactoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->subject->getIconForResource($resourceProphecy->reveal())->render());
        }
 
+       //////////////////////////////////////////////
+       // Tests concerning getIconForResource
+       //////////////////////////////////////////////
+       /**
+        * Tests the returns of no file
+        *
+        * @test
+        */
+       public function getIconForResourceWithFileWithoutExtensionTypeReturnsOtherIcon() {
+               $fileObject = $this->getTestSubjectFileObject('');
+               $result = $this->subject->getIconForResource($fileObject)->render();
+               $this->assertContains('<span class="icon icon-size-default icon-state-default icon-mimetypes-other-other">', $result);
+       }
+
+       /**
+        * Tests the returns of unknown file
+        *
+        * @test
+        */
+       public function getIconForResourceWithUnknownFileTypeReturnsOtherIcon() {
+               $fileObject = $this->getTestSubjectFileObject('foo');
+               $result = $this->subject->getIconForResource($fileObject)->render();
+               $this->assertContains('<span class="icon icon-size-default icon-state-default icon-mimetypes-other-other">', $result);
+       }
+
+       /**
+        * Tests the returns of file pdf
+        *
+        * @test
+        */
+       public function getIconForResourceWithPdfReturnsPdfIcon() {
+               $fileObject = $this->getTestSubjectFileObject('pdf');
+               $result = $this->subject->getIconForResource($fileObject)->render();
+               $this->assertContains('<span class="icon icon-size-default icon-state-default icon-mimetypes-pdf">', $result);
+       }
+
+       /**
+        * Tests the returns of file png
+        *
+        * @test
+        */
+       public function getIconForResourceWithPngFileReturnsIcon() {
+               $fileObject = $this->getTestSubjectFileObject('png');
+               $result = $this->subject->getIconForResource($fileObject)->render();
+               $this->assertContains('<span class="icon icon-size-default icon-state-default icon-mimetypes-media-image">', $result);
+       }
+
+       /**
+        * Tests the returns of normal folder
+        *
+        * @test
+        */
+       public function getIconForResourceWithFolderReturnsFolderIcon() {
+               $folderObject = $this->getTestSubjectFolderObject('/test');
+               $result = $this->subject->getIconForResource($folderObject)->render();
+               $this->assertContains('<span class="icon icon-size-default icon-state-default icon-apps-filetree-folder-default">', $result);
+       }
+
+       /**
+        * Tests the returns of open folder
+        *
+        * @test
+        */
+       public function getIconForResourceWithOpenFolderReturnsOpenFolderIcon() {
+               $folderObject = $this->getTestSubjectFolderObject('/test');
+               $result = $this->subject->getIconForResource($folderObject, Icon::SIZE_DEFAULT, NULL,  array('folder-open' => TRUE))->render();
+               $this->assertContains('<span class="icon icon-size-default icon-state-default icon-apps-filetree-folder-opened">', $result);
+       }
+
+       /**
+        * Tests the returns of root folder
+        *
+        * @test
+        */
+       public function getIconForResourceWithRootFolderReturnsRootFolderIcon() {
+               $folderObject = $this->getTestSubjectFolderObject('/');
+               $result = $this->subject->getIconForResource($folderObject)->render();
+               $this->assertContains('<span class="icon icon-size-default icon-state-default icon-apps-filetree-root">', $result);
+       }
+
+       /**
+        * Tests the returns of mount root
+        *
+        * @test
+        */
+       public function getIconForResourceWithMountRootReturnsMountFolderIcon() {
+               $folderObject = $this->getTestSubjectFolderObject('/mount');
+               $result = $this->subject->getIconForResource($folderObject, Icon::SIZE_DEFAULT, NULL, array('mount-root' => TRUE))->render();
+               $this->assertContains('<span class="icon icon-size-default icon-state-default icon-apps-filetree-mount">', $result);
+       }
+
        //
        // Test for getIconForRecord
        //
 
+       /**
+        * Tests the returns of tt_content + empty record
+        *
+        * @test
+        */
+       public function getIconForRecordWithEmptyRecordReturnsNormalIcon() {
+               $GLOBALS['TCA'] = array(
+                       'tt_content' => array(
+                               'ctrl' => array(
+                                       'typeicon_column' => 'CType',
+                                       'typeicon_classes' => array(
+                                               'default' => 'mimetypes-x-content-text',
+                                       ),
+                               ),
+                       ),
+               );
+               $result = $this->subject->getIconForRecord('tt_content', array())->render();
+               $this->assertContains('<span class="icon icon-size-default icon-state-default icon-mimetypes-x-content-text">', $result);
+       }
+
+       /**
+        * Tests the returns of tt_content + mock record
+        *
+        * @test
+        */
+       public function getIconForRecordWithMockRecordReturnsNormalIcon() {
+               $GLOBALS['TCA'] = array(
+                       'tt_content' => array(
+                               'ctrl' => array(
+                                       'typeicon_column' => 'CType',
+                                       'typeicon_classes' => array(
+                                               'text' => 'mimetypes-x-content-text',
+                                       ),
+                               ),
+                       ),
+               );
+               $result = $this->subject->getIconForRecord('tt_content', $this->mockRecord)->render();
+               $this->assertContains('<span class="icon icon-size-default icon-state-default icon-mimetypes-x-content-text">', $result);
+       }
+
+       /**
+        * Tests the returns of tt_content + mock record of type 'list' (aka plugin)
+        *
+        * @test
+        */
+       public function getIconForRecordWithMockRecordOfTypePluginReturnsPluginIcon() {
+               $GLOBALS['TCA'] = array(
+                       'tt_content' => array(
+                               'ctrl' => array(
+                                       'typeicon_column' => 'CType',
+                                       'typeicon_classes' => array(
+                                               'list' => 'mimetypes-x-content-plugin',
+                                       ),
+                               ),
+                       ),
+               );
+               $mockRecord = $this->mockRecord;
+               $mockRecord['CType'] = 'list';
+               $result = $this->subject->getIconForRecord('tt_content', $mockRecord)->render();
+               $this->assertContains('<span class="icon icon-size-default icon-state-default icon-mimetypes-x-content-plugin">', $result);
+       }
+
+       /**
+        * Tests the returns of tt_content + mock record with hidden flag
+        *
+        * @test
+        */
+       public function getIconForRecordWithMockRecordWithHiddenFlagReturnsNormalIconAndOverlay() {
+               $GLOBALS['TCA'] = array(
+                       'tt_content' => array(
+                               'ctrl' => array(
+                                       'enablecolumns' => array(
+                                               'disabled' => 'hidden',
+                                       ),
+                                       'typeicon_column' => 'CType',
+                                       'typeicon_classes' => array(
+                                               'text' => 'mimetypes-x-content-text',
+                                       ),
+                               ),
+                       ),
+               );
+               $mockRecord = $this->mockRecord;
+               $mockRecord['hidden'] = '1';
+               $result = $this->subject->getIconForRecord('tt_content', $mockRecord)->render();
+               $overlay = '<span class="t3-icon t3-icon-status t3-icon-status-overlay t3-icon-overlay-hidden t3-icon-overlay"> </span>';
+               $this->assertContains('<span class="icon icon-size-default icon-state-default icon-mimetypes-x-content-text">', $result);
+               $this->assertContains('<span class="icon-overlay icon-overlay-hidden">', $result);
+       }
+
+       /**
+        * Create file object to use as test subject
+        *
+        * @param $extension
+        * @return \TYPO3\CMS\Core\Resource\File
+        */
+       protected function getTestSubjectFileObject($extension) {
+               $mockedStorage = $this->getMock(\TYPO3\CMS\Core\Resource\ResourceStorage::class, array(), array(), '', FALSE);
+               $mockedFile = $this->getMock(\TYPO3\CMS\Core\Resource\File::class, array(), array(array(), $mockedStorage));
+               $mockedFile->expects($this->once())->method('getExtension')->will($this->returnValue($extension));
+               return $mockedFile;
+       }
+
+       /**
+        * Create folder object to use as test subject
+        *
+        * @param string $identifier
+        * @return \TYPO3\CMS\Core\Resource\Folder
+        */
+       protected function getTestSubjectFolderObject($identifier) {
+               $mockedStorage = $this->getMock(\TYPO3\CMS\Core\Resource\ResourceStorage::class, array(), array(), '', FALSE);
+               $mockedStorage->expects($this->any())->method('getRootLevelFolder')->will($this->returnValue(
+                       new \TYPO3\CMS\Core\Resource\Folder($mockedStorage, '/', '/')
+               ));
+               $mockedStorage->expects($this->any())->method('checkFolderActionPermission')->will($this->returnValue(TRUE));
+               $mockedStorage->expects($this->any())->method('isBrowsable')->will($this->returnValue(TRUE));
+               return new \TYPO3\CMS\Core\Resource\Folder($mockedStorage, $identifier, $identifier);
+       }
 
 }
index 332179e..164d315 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Documentation\Slots;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
index 7eec0d1..057bc81 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
index cd945dd..35ae344 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
index 27a46ac..f1267c0 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
index de834fd..8475285 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Extensionmanager\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
index 666db68..3b60905 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Feedit;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Backend\FrontendBackendUserAuthentication;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Imaging\Icon;
index 75d0405..66c76f5 100644 (file)
@@ -16,11 +16,9 @@ namespace TYPO3\CMS\Filelist\Controller;
 
 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\Messaging\FlashMessage;
-use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Resource\DuplicationBehavior;
 use TYPO3\CMS\Core\Resource\Exception;
 use TYPO3\CMS\Core\Resource\Folder;
index 0c5d805..aaf1401 100644 (file)
@@ -18,7 +18,6 @@ use TYPO3\CMS\Backend\Clipboard\Clipboard;
 use TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider;
 use TYPO3\CMS\Backend\RecordList\AbstractRecordList;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
index aa25362..ba10277 100644 (file)
@@ -3,14 +3,14 @@ defined('TYPO3_MODE') or die();
 
 // add an CType element "mailform"
 $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['mailform'] = 'mimetypes-x-content-form';
-$GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['mailform'] = 'tt_content_form.gif';
+$GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['mailform'] = 'EXT:t3skin/icons/gfx/i/tt_content_form.gif';
 
 // check if there is already a forms tab and add the item after that, otherwise
 // add the tab item as well
 $additionalCTypeItem = array(
        'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:CType.I.8',
        'mailform',
-       'i/tt_content_form.gif'
+       'EXT:t3skin/icons/gfx/i/tt_content_form.gif'
 );
 
 $existingCTypeItems = $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'];
index 6de7469..0c06486 100644 (file)
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Frontend\Controller;
 
 use TYPO3\CMS\Backend\Tree\View\PageTreeView;
 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;
index 511b2ab..e9a56bd 100755 (executable)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Frontend\View;
  */
 
 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\Type\Bitmask\Permission;
index 32c49b7..b83c504 100644 (file)
@@ -7,7 +7,7 @@ return array(
                'cruser_id' => 'cruser_id',
                'sortby' => 'sorting',
                'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:sys_domain',
-               'iconfile' => 'domain.gif',
+               'iconfile' => 'EXT:t3skin/icons/gfx/i/domain.gif',
                'enablecolumns' => array(
                        'disabled' => 'hidden'
                ),
index fda1dcf..76f50a5 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'delete' => 'deleted',
                'adminOnly' => 1,
                // Only admin, if any
-               'iconfile' => 'template.gif',
+               'iconfile' => 'EXT:t3skin/icons/gfx/i/template.gif',
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                        'starttime' => 'starttime',
index 63adbb8..9a577cc 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Impexp\Controller;
 
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
index 6f1db1b..df2d615 100644 (file)
@@ -13,7 +13,6 @@ namespace TYPO3\CMS\Impexp\View;
  *
  * The TYPO3 project - inspiring people to share!
  */
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
index 0eaa203..2623c0a 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\IndexedSearch\Domain\Repository;
 
 use TYPO3\CMS\Backend\FrontendBackendUserAuthentication;
 use TYPO3\CMS\Backend\Tree\View\PageTreeView;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Cache\CacheManager;
 use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
index f4d6774..d195c8e 100644 (file)
@@ -18,7 +18,6 @@ use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Module\BaseScriptClass;
 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;
index 83c4f99..13aa539 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\InfoPagetsconfig\Controller;
  */
 
 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;
index 29465b9..c47061a 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Linkvalidator\Report;
 
 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\Messaging\FlashMessage;
index d8dfde6..9376fe0 100644 (file)
@@ -18,7 +18,6 @@ use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
 use TYPO3\CMS\Backend\Module\BaseScriptClass;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Database\QueryView;
 use TYPO3\CMS\Core\Database\ReferenceIndex;
 use TYPO3\CMS\Core\Imaging\Icon;
index 5f20526..8d5bcb4 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Opendocs\Backend\ToolbarItems;
  */
 
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Page\PageRenderer;
index 1522a7d..a7f6538 100755 (executable)
@@ -22,7 +22,6 @@ use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView;
 use TYPO3\CMS\Backend\Tree\View\ElementBrowserPageTreeView;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\ElementBrowser\ElementBrowserHookInterface;
@@ -1829,14 +1828,13 @@ class ElementBrowser {
                                $c++;
                                if ($renderFolders) {
                                        $fileIdentifier = $fileOrFolderObject->getCombinedIdentifier();
-                                       $overlays = array();
+                                       $overlay = NULL;
                                        if ($fileOrFolderObject instanceof InaccessibleFolder) {
-                                               $overlays = array('status-overlay-locked' => array());
+                                               $overlay = array('status-overlay-locked' => array());
                                        }
-                                       $icon = IconUtility::getSpriteIcon(
-                                               IconUtility::mapFileExtensionToSpriteIconName('folder'),
-                                               array('title' => $fileOrFolderObject->getName()),
-                                               $overlays);
+                                       $icon = '<span title="' . htmlspecialchars($fileOrFolderObject->getName()) . '">'
+                                               . $this->iconFactory->getIcon('apps-filetree-folder-default', Icon::SIZE_SMALL, $overlay)->render()
+                                               . '</span>';
                                        $itemUid = 'file:' . $fileIdentifier;
                                } else {
                                        $fileIdentifier = $fileOrFolderObject->getUid();
@@ -2138,7 +2136,7 @@ class ElementBrowser {
 
                $out .= $this->barheader(sprintf($lang->getLL('files') . ' (%s):', count($files)));
                $titleLen = (int)$this->getBackendUser()->uc['titleLen'];
-               $picon = IconUtility::getSpriteIcon('apps-filetree-folder-default');
+               $picon = $this->iconFactory->getIcon('apps-filetree-folder-default', Icon::SIZE_SMALL)->render();
                $picon .= htmlspecialchars(GeneralUtility::fixed_lgd_cs(basename($folder->getName()), $titleLen));
                $out .= $picon . '<br />';
                // Init row-array:
index 8819a96..dc07c27 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Recordlist\Tree\View;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
index 33939b9..17f3220 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Recycler\Controller;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
index 4429fac..b2fbc03 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\SysAction\Backend\ToolbarItems;
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
diff --git a/typo3/sysext/t3skin/Classes/Slot/IconStyleModifier.php b/typo3/sysext/t3skin/Classes/Slot/IconStyleModifier.php
deleted file mode 100644 (file)
index cb4e0ae..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-<?php
-namespace TYPO3\CMS\T3skin\Slot;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Slot for IconUtility
- */
-class IconStyleModifier {
-
-       protected $flatSpriteIconName = array(
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-close' => 'fa-close',
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-export-csv' => 'fa-download',
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-export-t3d' => 'fa-download',
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-history-open' => 'fa-history',
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-import-t3d' => 'fa-upload',
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-edit-access' => 'fa-clock-o',
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-info' => 'fa-info-circle',
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-move c-inputButton' => 'fa-arrows',
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-move' => 'fa-arrows',
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-new' => 'fa-plus-square',
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-open' => 'fa-pencil',
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-select' => 'fa-check-square-o',
-               't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-view' => 'fa-desktop',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-add' => 'fa-plus-circle',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-copy' => 'fa-copy',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-copy-release' => 'fa-copy danger',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-cut' => 'fa-cut',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-cut-release' => 'fa-cut danger',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-delete' => 'fa-trash',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-download' => 'fa-download',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-edit' => 'fa-pencil',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-hide' => 'fa-toggle-on',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-paste' => 'fa-paste',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-pick-date' => 'fa-calendar',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-rename' => 'fa-quote-right',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-replace' => 'fa-retweet',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-undo' => 'fa-undo',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-unhide' => 'fa-toggle-off warning',
-               't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-upload' => 'fa-upload',
-               't3-icon t3-icon-actions t3-icon-actions-input t3-icon-input-clear' => 'fa-times-circle',
-               // @todo t3-btn-* is still used in FormEngine.js refactor to use data attributes in HTML
-               't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-down t3-btn t3-btn-moveoption-down' => 'fa-angle-down t3-btn t3-btn-moveoption-down',
-               't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-to-bottom t3-btn t3-btn-moveoption-bottom' => 'fa-angle-double-down t3-btn t3-btn-moveoption-bottom',
-               't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-to-bottom' => 'fa-angle-double-down',
-               't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-down' => 'fa-angle-down',
-               't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-left' => 'fa-angle-left',
-               't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-right' => 'fa-angle-right',
-               // @todo t3-btn-* is still used in FormEngine.js refactor to use data attributes in HTML
-               't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-to-top' => 'fa-angle-double-up',
-               't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-to-top t3-btn t3-btn-moveoption-top' => 'fa-angle-double-up t3-btn t3-btn-moveoption-top',
-               't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-up t3-btn t3-btn-moveoption-up' => 'fa-angle-up t3-btn t3-btn-moveoption-up',
-               't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-up' => 'fa-angle-up',
-               // @todo t3-btn-* is still used in FormEngine.js refactor to use data attributes in HTML
-               't3-icon t3-icon-actions t3-icon-actions-selection t3-icon-selection-delete t3-btn t3-btn-removeoption' => 'fa-times t3-btn t3-btn-removeoption',
-               't3-icon t3-icon-actions t3-icon-actions-selection t3-icon-selection-delete' => 'fa-remove',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-backend-user-emulate' => 'fa-sign-in',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-backend-user-switch' => 'fa-sign-out',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-cache-clear' => 'fa-bolt',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-configure' => 'fa-gear',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-documentation' => 'fa-anchor',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-download ' => 'fa-cloud-download',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-download' => 'fa-download',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-import' => 'fa-cloud-download',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-install' => 'fa-plus-circle',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-sqldump' => 'fa-database',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-update' => 'fa-refresh',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-uninstall' => 'fa-minus-square',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-list-open' => 'fa-list-alt',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-refresh' => 'fa-refresh',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-shortcut-new' => 'fa-star',
-               't3-icon t3-icon-actions t3-icon-actions-template t3-icon-template-new' => 'fa-plus',
-               't3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-go-back' => 'fa-angle-double-left',
-               't3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-go-forward' => 'fa-angle-double-right',
-               't3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-go-up' => 'fa-level-up',
-               't3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-list-collapse collapseIcon' => 'fa-chevron-up',
-               't3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-list-expand collapseIcon' => 'fa-chevron-down',
-               't3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-paging-first' => 'fa-step-backward',
-               't3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-paging-last' => 'fa-step-forward',
-               't3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-paging-next' => 'fa-arrow-right',
-               't3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-paging-previous' => 'fa-arrow-left',
-               't3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-table-expand' => 'fa-chevron-right',
-               't3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-table-collapse' => 'fa-chevron-left',
-               't3-icon t3-icon-actions t3-icon-actions-window t3-icon-window-open' => 'fa-arrows-alt',
-               't3-icon t3-icon-actions t3-icon-system-extension-import' => 'fa-cloud-download',
-               't3-icon t3-icon-apps t3-icon-apps-toolbar t3-icon-toolbar-menu-actions' => 'fa-cog',
-               't3-icon t3-icon-apps t3-icon-apps-toolbar t3-icon-toolbar-menu-cache' => 'fa-bolt',
-               't3-icon t3-icon-apps t3-icon-apps-toolbar t3-icon-toolbar-menu-opendocs' => 'fa-file',
-               't3-icon t3-icon-apps t3-icon-apps-toolbar t3-icon-toolbar-menu-shortcut' => 'fa-star',
-               't3-icon t3-icon-apps t3-icon-apps-toolbar t3-icon-toolbar-menu-workspace' => 'fa-th-large',
-               't3-icon t3-icon-extensions t3-icon-extensions-extensionmanager t3-icon-extensionmanager-update-script' => 'fa-refresh',
-               't3-icon t3-icon-extensions t3-icon-extensions-scheduler t3-icon-scheduler-run-task' => 'fa-play-circle',
-               't3-icon t3-icon-mimetypes t3-icon-mimetypes-pdf t3-icon-pdf' => 'fa-file-pdf-o',
-               't3-icon t3-icon-mimetypes t3-icon-mimetypes-text t3-icon-text-html' => 'fa-file-text-o',
-               't3-icon t3-icon-mimetypes t3-icon-mimetypes-word t3-icon-word' => 'fa-file-word-o',
-               't3-icon t3-icon-mimetypes t3-icon-mimetypes-x t3-icon-x-sys_language' => 'fa-globe',
-               't3-icon t3-icon-mimetypes t3-icon-mimetypes-text t3-icon-text-js' => 'fa-code',
-               't3-icon t3-icon-status t3-icon-status-dialog t3-icon-dialog-error' => 'fa-exclamation-circle',
-               't3-icon t3-icon-status t3-icon-status-dialog t3-icon-dialog-warning' => 'fa-exclamation-triangle',
-               't3-icon t3-icon-status t3-icon-status-dialog t3-icon-dialog-information' => 'fa-info-circle',
-               't3-icon t3-icon-status t3-icon-status-status t3-icon-status-locked' => 'fa-lock',
-               't3-icon t3-icon-status t3-icon-status-status t3-icon-status-permission-denied' => 'fa-times',
-               't3-icon t3-icon-status t3-icon-status-status t3-icon-status-permission-granted' => 'fa-check',
-               't3-icon t3-icon-status t3-icon-status-status t3-icon-status-readonly' => 'fa-lock',
-               't3-icon t3-icon-status t3-icon-status-status t3-icon-status-sorting-light-asc' => 'fa-angle-up',
-               't3-icon t3-icon-status t3-icon-status-status t3-icon-status-sorting-light-desc' => 'fa-angle-down',
-               't3-icon t3-icon-status t3-icon-status-warning t3-icon-warning-lock' => 'fa-lock',
-               't3-icon t3-icon-status t3-icon-status-status t3-icon-status-checked' => 'fa-check',
-               't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-move sortableHandle' => 'fa-reorder sortableHandle',
-               't3-icon t3-icon-actions t3-icon-actions-move t3-icon-move-move' => 'fa-reorder',
-               't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-options-view' => 'fa-list-alt',
-               't3-icon t3-icon-module t3-icon-module-web t3-icon-web' => 'fa-file-o',
-               't3-icon t3-icon-module t3-icon-module-file t3-icon-file' => 'fa-image',
-               't3-icon t3-icon-module t3-icon-module-tools t3-icon-tools' => 'fa-rocket',
-               't3-icon t3-icon-module t3-icon-module-system t3-icon-system' => 'fa-plug',
-               't3-icon t3-icon-module t3-icon-module-help t3-icon-help' => 'fa-fw fa-question-circle'
-       );
-
-       /**
-        * Hook to manipulate IconUtility html output code
-        *
-        * @param array $tagAttributes
-        * @param null $innerHtml
-        * @param null $tagName
-        * @return array
-        */
-       public function buildSpriteHtmlIconTag(array $tagAttributes, $innerHtml, $tagName) {
-               $classNames = $tagAttributes['class'];
-               if (strpos($classNames, 'fa-') !== FALSE) {
-                       $tagAttributes['class'] = 't3-icon fa ' . $classNames;
-               } else {
-                       $classNames = !empty($this->flatSpriteIconName[$classNames]) ? $this->flatSpriteIconName[$classNames] : NULL;
-                       if ($classNames !== NULL) {
-                               $tagAttributes['class'] = 't3-icon fa ' . $classNames;
-                       }
-               }
-
-               return array($tagAttributes, $innerHtml, $tagName);
-       }
-
-       /**
-        * returns the old class name if modified, otherwise the replaced fa icon
-        *
-        * @param string $iconName
-        * @param string $cssClasses
-        * @return string
-        */
-       public function buildSpriteIconClasses($iconName, &$cssClasses) {
-               if (strpos($iconName, 'fa-') !== FALSE) {
-                       $cssClasses = 't3-icon fa ' . $iconName;
-               } elseif (isset($this->flatSpriteIconName[$cssClasses])) {
-                       $cssClasses = 't3-icon fa ' . $this->flatSpriteIconName[$cssClasses];
-               }
-       }
-
-}
index 3f4340c..fcba6e9 100644 (file)
@@ -7867,6 +7867,9 @@ button.close {
 .icon-status-status-sorting-desc {
   color: #737373;
 }
+.icon-status-dialog-information {
+  color: #6daae0;
+}
 .icon-status-dialog-ok,
 .icon-status-status-permission-granted {
   color: #79a548;
@@ -10058,7 +10061,9 @@ ul.typo3-messages {
   padding: 1px 0 1px 2px;
 }
 #typo3-pagetree-topPanel-filterWrap .t3-icon-input-clear {
-  right: 2px;
+  position: absolute;
+  right: 6px;
+  top: 3px;
 }
 #typo3-pagetree-topPanel-defaultPanel {
   padding-left: 6px;
index 0439070..cb0a60a 100644 (file)
@@ -5,16 +5,3 @@ defined('TYPO3_MODE') or die();
        RTE.default.skin = EXT:t3skin/rtehtmlarea/htmlarea.css
        RTE.default.FE.skin = EXT:t3skin/rtehtmlarea/htmlarea.css
 ');
-
-\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class)->connect(
-       \TYPO3\CMS\Backend\Utility\IconUtility::class,
-       'buildSpriteHtmlIconTag',
-       \TYPO3\CMS\T3skin\Slot\IconStyleModifier::class,
-       'buildSpriteHtmlIconTag'
-);
-\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class)->connect(
-       \TYPO3\CMS\Backend\Utility\IconUtility::class,
-       'buildSpriteIconClasses',
-       \TYPO3\CMS\T3skin\Slot\IconStyleModifier::class,
-       'buildSpriteIconClasses'
-);
index 54f4f1f..e8bd16e 100644 (file)
@@ -30,7 +30,7 @@ if (TYPO3_MODE === 'BE' || TYPO3_MODE === 'FE' && isset($GLOBALS['BE_USER'])) {
        );
 
        // Changing icon for filemounts, needs to be done here as overwriting the original icon would also change the filelist tree's root icon
-       $GLOBALS['TCA']['sys_filemounts']['ctrl']['iconfile'] = '_icon_ftp_2.gif';
+       $GLOBALS['TCA']['sys_filemounts']['ctrl']['iconfile'] = 'EXT:t3skin/icons/gfx/i/_icon_ftp_2.gif';
 
        $GLOBALS['TCA']['pages']['columns']['module']['config']['items'][1][2] = 'EXT:t3skin/images/icons/status/user-frontend.png';
 
index e370145..0ce3e72 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Tstemplate\Controller;
 
 use TYPO3\CMS\Backend\Module\AbstractFunctionModule;
 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\TypoScript\ExtendedTemplateService;
index 8586d28..c3c54ce 100644 (file)
@@ -16,14 +16,12 @@ namespace TYPO3\CMS\Tstemplate\Controller;
 
 use TYPO3\CMS\Backend\Module\AbstractFunctionModule;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Frontend\Page\PageRepository;
 
 /**
index 2f36769..78f7459 100644 (file)
@@ -21,9 +21,7 @@ use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
 use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\HttpUtility;
-use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Backend\Module\AbstractFunctionModule;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Lang\LanguageService;
 
index b560b3d..5fb34f0 100755 (executable)
@@ -21,13 +21,10 @@ use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
-use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
-use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Fluid\View\StandaloneView;
 use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper;
 
index 0ad85b8..a6d460c 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Tstemplate\Controller;
 
 use TYPO3\CMS\Backend\Module\AbstractFunctionModule;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
@@ -25,7 +24,6 @@ use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
-use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Fluid\View\StandaloneView;
 use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper;
 use TYPO3\CMS\Frontend\Page\PageRepository;
index dc0ce98..dccf116 100644 (file)
@@ -22,7 +22,6 @@ use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\DiffUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Utility\IconUtility;
 
 /**
  * Versioning module, including workspace management
diff --git a/typo3/sysext/version/Classes/Hook/IconUtilityHook.php b/typo3/sysext/version/Classes/Hook/IconUtilityHook.php
deleted file mode 100644 (file)
index ae2a606..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-namespace TYPO3\CMS\Version\Hook;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Versioning\VersionState;
-
-/**
- * Implements a hook for \TYPO3\CMS\Backend\Utility\IconUtility
- */
-class IconUtilityHook {
-
-       /**
-        * Visualizes the deleted status for a versionized record.
-        *
-        * @param string $table Name of the table
-        * @param array $row Record row containing the field values
-        * @param array $status Status to be used for rendering the icon
-        * @return void
-        */
-       public function overrideIconOverlay($table, array $row, array &$status) {
-               if (
-                       isset($row['t3ver_state'])
-                       && VersionState::cast($row['t3ver_state'])->equals(
-                               VersionState::DELETE_PLACEHOLDER
-                       )
-               ) {
-                       $status['deleted'] = TRUE;
-               }
-       }
-
-}
index e6e1dc8..6ad4ca3 100644 (file)
@@ -5,9 +5,6 @@ defined('TYPO3_MODE') or die();
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['version'] = \TYPO3\CMS\Version\Hook\DataHandlerHook::class;
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass']['version'] = \TYPO3\CMS\Version\Hook\DataHandlerHook::class;
 
-// Register hook for overriding the icon status overlay
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay']['version'] = \TYPO3\CMS\Version\Hook\IconUtilityHook::class;
-
 // Register hook to check for the preview mode in the FE
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB']['version_preview'] = \TYPO3\CMS\Version\Hook\PreviewHook::class . '->checkForPreview';
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['postBeUser']['version_preview'] = \TYPO3\CMS\Version\Hook\PreviewHook::class . '->initializePreviewUser';
index f57adde..df31579 100644 (file)
@@ -14,7 +14,7 @@ namespace TYPO3\CMS\WizardCrpages\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Backend\Form\Utility\FormEngineUtility;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
@@ -261,7 +261,7 @@ class CreatePagesWizardModuleFunctionController extends \TYPO3\CMS\Backend\Modul
                        foreach ($items as $item) {
                                $label = $this->getLanguageService()->sL($item[0], TRUE);
                                $value = $item[1];
-                               $icon = (!empty($item[2]) ? '<img src="' . IconUtility::skinImg('', 'gfx/' . $item[2], '', 1) . '" />' : '');
+                               $icon = !empty($item[2]) ? FormEngineUtility::getIconHtml($item[2], $label, $label) : '';
                                $groupContent .= '<option value="' . htmlspecialchars($value) . '" data-icon="' . htmlspecialchars($icon) . '">' . $label . '</option>';
                        }
                        $groupLabel = $this->getLanguageService()->sL($groupLabel, TRUE);
index 63e0f1d..d2f31c3 100644 (file)
@@ -50,11 +50,11 @@ class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
                $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                $icons = array(
                        'language' => $iconFactory->getIcon('flags-multiple', Icon::SIZE_SMALL)->render(),
-                       'integrity' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-information'),
-                       'success' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-ok'),
-                       'info' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-information'),
-                       'warning' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-warning'),
-                       'error' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-error')
+                       'integrity' => $iconFactory->getIcon('status-dialog-information', Icon::SIZE_SMALL)->render(),
+                       'success' => $iconFactory->getIcon('status-dialog-ok', Icon::SIZE_SMALL)->render(),
+                       'info' => $iconFactory->getIcon('status-dialog-information', Icon::SIZE_SMALL)->render(),
+                       'warning' => $iconFactory->getIcon('status-dialog-warning', Icon::SIZE_SMALL)->render(),
+                       'error' => $iconFactory->getIcon('status-dialog-error', Icon::SIZE_SMALL)->render()
                );
                $this->pageRenderer->addInlineSetting('Workspaces', 'icons', $icons);
                $this->pageRenderer->addInlineSetting('Workspaces', 'id', $this->pageId);
index 5e5dc3a..b90617f 100644 (file)
@@ -116,8 +116,9 @@ class ExtDirectServer extends AbstractHandler {
                $parseObj = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Html\RteHtmlParser::class);
                $liveRecord = BackendUtility::getRecord($parameter->table, $parameter->t3ver_oid);
                $versionRecord = BackendUtility::getRecord($parameter->table, $parameter->uid);
-               $icon_Live = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($parameter->table, $liveRecord);
-               $icon_Workspace = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($parameter->table, $versionRecord);
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+               $icon_Live = $iconFactory->getIconForRecord($parameter->table, $liveRecord, Icon::SIZE_SMALL)->render();
+               $icon_Workspace = $iconFactory->getIconForRecord($parameter->table, $versionRecord, Icon::SIZE_SMALL)->render();
                $stagePosition = $this->getStagesService()->getPositionOfCurrentStage($parameter->stage);
                $fieldsOfRecords = array_keys($liveRecord);
                if ($GLOBALS['TCA'][$parameter->table]) {
index 0c90a62..5aed180 100644 (file)
@@ -15,6 +15,8 @@ namespace TYPO3\CMS\Workspaces\Service;
  */
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -117,6 +119,8 @@ class GridDataService {
                $swapStage = $workspaceAccess['publish_access'] & 1 ? \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_ID : 0;
                $swapAccess = $GLOBALS['BE_USER']->workspacePublishAccess($GLOBALS['BE_USER']->workspace) && $GLOBALS['BE_USER']->workspaceSwapAccess();
                $this->initializeWorkspacesCachingFramework();
+               /** @var IconFactory $iconFactory */
+               $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                // check for dataArray in cache
                if ($this->getDataArrayFromCache($versions, $filterTxt) === FALSE) {
                        /** @var $stagesObj \TYPO3\CMS\Workspaces\Service\StagesService */
@@ -168,13 +172,12 @@ class GridDataService {
                                        $versionArray['t3ver_oid'] = $record['t3ver_oid'];
                                        $versionArray['livepid'] = $record['livepid'];
                                        $versionArray['stage'] = $versionRecord['t3ver_stage'];
-                                       $versionArray['icon_Live'] = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($table, $origRecord);
-                                       $versionArray['icon_Workspace'] = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($table, $versionRecord);
+                                       $versionArray['icon_Live'] = $iconFactory->getIconForRecord($table, $origRecord, Icon::SIZE_SMALL)->render();
+                                       $versionArray['icon_Workspace'] = $iconFactory->getIconForRecord($table, $versionRecord, Icon::SIZE_SMALL)->render();
                                        $languageValue = $this->getLanguageValue($table, $versionRecord);
                                        $versionArray['languageValue'] = $languageValue;
                                        $versionArray['language'] = array(
-                                               'cls' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses($this->getSystemLanguageValue($languageValue, 'flagIcon')),
-                                               'title' => htmlspecialchars($this->getSystemLanguageValue($languageValue, 'title'))
+                                               'icon' => $iconFactory->getIcon($this->getSystemLanguageValue($languageValue, 'flagIcon'), Icon::SIZE_SMALL)->render()
                                        );
                                        $versionArray['allowedAction_nextStage'] = $isRecordTypeAllowedToModify && $stagesObj->isNextStageAllowedForUser($versionRecord['t3ver_stage']);
                                        $versionArray['allowedAction_prevStage'] = $isRecordTypeAllowedToModify && $stagesObj->isPrevStageAllowedForUser($versionRecord['t3ver_stage']);
index 4057931..0b6da47 100644 (file)
@@ -7,7 +7,7 @@ return array(
                'adminOnly' => 1,
                'rootLevel' => 1,
                'delete' => 'deleted',
-               'iconfile' => 'sys_workspace.png',
+               'iconfile' => 'EXT:t3skin/icons/gfx/i/sys_workspace.png',
                'typeicon_classes' => array(
                        'default' => 'mimetypes-x-sys_workspace'
                ),
index 00603cc..9f36cb9 100644 (file)
@@ -9,7 +9,7 @@ return array(
                'rootLevel' => 1,
                'hideTable' => TRUE,
                'delete' => 'deleted',
-               'iconfile' => 'sys_workspace.png',
+               'iconfile' => 'EXT:t3skin/icons/gfx/i/sys_workspace.png',
                'typeicon_classes' => array(
                        'default' => 'mimetypes-x-sys_workspace'
                ),
index c566a7b..25d644a 100644 (file)
@@ -11,10 +11,10 @@ TYPO3.Workspaces.Component.RowExpander = Ext.extend(Ext.grid.RowExpander, {
                                '<table class="char_select_template" width="100%">',
                                        '<tr class="header">',
                                                '<th class="char_select_profile_titleLeft">',
-                                                       '<span class="icon {icon_Workspace}">&nbsp;</span>{[TYPO3.l10n.localize(\'workspace_version\')]}',
+                                                       '{icon_Workspace} {[TYPO3.l10n.localize(\'workspace_version\')]}',
                                                '</th>',
                                                '<th class="char_select_profile_titleRight">',
-                                                       '<span class="icon {icon_Live}"></span>{[TYPO3.l10n.localize(\'live_workspace\')]}',
+                                                       '{icon_Live} {[TYPO3.l10n.localize(\'live_workspace\')]}',
                                                '</th>',
                                        '</tr>',
                                        '<tr>',
index 1743e83..f790a00 100644 (file)
@@ -49,14 +49,14 @@ TYPO3.Workspaces.Configuration.Integrity = new Ext.grid.Column({
        width: 24,
        hideable: true,
        sortable: false,
-       header: '<span class="' + TYPO3.settings.Workspaces.icons.integrity + '">&nbsp;</span>',
+       header: TYPO3.settings.Workspaces.icons.integrity + '&nbsp;',
        renderer: function(value, meta, record) {
                if (record.json.integrity.status !== 'success') {
-                       var cls = TYPO3.settings.Workspaces.icons[record.json.integrity.status] + ' t3-visible';
+                       var icon = TYPO3.settings.Workspaces.icons[record.json.integrity.status];
                        var title = TYPO3.l10n.localize('status.' + record.json.integrity.status);
                        var message = record.json.integrity.messages;
 
-                       return '<span class="' + cls + '" ext:qtitle="' + title + '" ext:qtip="' + message + '">&nbsp;</span>';
+                       return '<span ext:qtitle="' + title + '" ext:qtip="' + message + '">' + icon + '&nbsp;</span>';
                }
        }
 });
@@ -108,7 +108,7 @@ TYPO3.Workspaces.Configuration.WsTitleWithIcon = {
                value = "<span class=\"" + dekoClass + "\">" + value + "</span>";
                // Prepend icon
                if (record.json.icon_Live !== record.json.icon_Workspace) {
-                       valud = "<span class=\"" + record.json.icon_Workspace + "\">&nbsp;</span>&nbsp;" + value;
+                       value = record.json.icon_Workspace + "&nbsp;" + value;
                }
                // Prepend nested collection level
                var levelStyle = 'margin-left: ' + record.json.Workspaces_CollectionLevel * this.levelWidth + 'px;';
@@ -133,7 +133,7 @@ TYPO3.Workspaces.Configuration.Language = {
        header: TYPO3.settings.Workspaces.icons.language,
        filter: { type: 'string '},
        renderer: function(value, metaData, record) {
-               return '<span class="' + record.json.language.cls + '" title="' + record.json.language.title + '">&nbsp;</span>';
+               return record.json.language.icon;
        }
 };
 
@@ -151,7 +151,7 @@ TYPO3.Workspaces.Configuration.TitleWithIcon = {
                }
 
                value = "<span class=\"" + dekoClass + "\">" + value + "</span>";
-               return "<span class=\"" + record.json.icon_Live + "\">&nbsp;</span>&nbsp;" + value;
+               return record.json.icon_Live + "&nbsp;" + value;
        },
        filter : {type: 'string'}
 };