[BUGFIX] Register missing icons and fix spriteicon registration 37/43737/2
authorFrank Nägler <frank.naegler@typo3.org>
Fri, 2 Oct 2015 10:39:33 +0000 (12:39 +0200)
committerFrans Saris <franssaris@gmail.com>
Fri, 2 Oct 2015 14:46:00 +0000 (16:46 +0200)
This patch register some missing icons and fix the automatic
registration for sprite icons which path starts with sysext/.

Resolves: #70305
Releases: master
Change-Id: If935c74046118d75160f093c8fee1a05164620fd
Reviewed-on: http://review.typo3.org/43737
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/core/Classes/Imaging/IconRegistry.php

index f0d644c..ae28b2b 100644 (file)
@@ -1781,7 +1781,32 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                        'options' => array(
                                'source' => 'EXT:core/Resources/Public/Icons/Flags/wales.png'
                        )
-               )
+               ),
+
+               'tcarecords-sys_domain-default' => array(
+                       'provider' => SvgIconProvider::class,
+                       'options' => array(
+                               'source' => 'EXT:backend/Resources/Public/Icons/Overlay/overlay-translated.svg'
+                       )
+               ),
+               'tcarecords-sys_template-default' => array(
+                       'provider' => BitmapIconProvider::class,
+                       'options' => array(
+                               'source' => 'EXT:t3skin/images/icons/mimetypes/x-content-template.png'
+                       )
+               ),
+               'tcarecords-sys_workspace-default' => array(
+                       'provider' => BitmapIconProvider::class,
+                       'options' => array(
+                               'source' => 'EXT:t3skin/images/icons/mimetypes/x-sys_workspace.png'
+                       )
+               ),
+               'tcarecords-sys_workspace_stage-default' => array(
+                       'provider' => BitmapIconProvider::class,
+                       'options' => array(
+                               'source' => 'EXT:t3skin/images/icons/mimetypes/x-sys_workspace.png'
+                       )
+               ),
        );
 
        /**
@@ -2034,6 +2059,10 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                        if (is_array($GLOBALS['TCA'][$tableName])) {
                                $tcaCtrl = $GLOBALS['TCA'][$tableName]['ctrl'];
                                $icon = NULL;
+                               $iconIdentifier = 'tcarecords-' . $tableName . '-default';
+                               if ($this->isRegistered($iconIdentifier)) {
+                                       continue;
+                               }
                                if (isset($tcaCtrl['iconfile'])) {
                                        if (StringUtility::beginsWith($tcaCtrl['iconfile'], 'EXT:')) {
                                                $icon = $tcaCtrl['iconfile'];
@@ -2041,7 +2070,7 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                                $icon = TYPO3_mainDir . GeneralUtility::resolveBackPath($tcaCtrl['iconfile']);
                                        }
                                        if ($icon !== NULL) {
-                                               $resultArray['tcarecords-' . $tableName . '-default'] = $icon;
+                                               $resultArray[$iconIdentifier] = $icon;
                                        }
                                }
                        }
@@ -2051,6 +2080,9 @@ class IconRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                                if (StringUtility::beginsWith($iconFile, '../typo3conf/ext/')) {
                                        $iconFile = str_replace('../typo3conf/ext/', 'EXT:', $iconFile);
                                }
+                               if (StringUtility::beginsWith($iconFile, 'sysext/')) {
+                                       $iconFile = str_replace('sysext/', 'EXT:', $iconFile);
+                               }
                                $resultArray[$iconIdentifier] = $iconFile;
                        }
                }