[TASK] Implement EXT: resolving for iconfile option 24/41824/4
authorWouter Wolters <typo3@wouterwolters.nl>
Wed, 22 Jul 2015 15:46:13 +0000 (17:46 +0200)
committerBenjamin Mack <benni@typo3.org>
Sat, 25 Jul 2015 09:01:01 +0000 (11:01 +0200)
Resolves: #68469
Releases: master
Change-Id: Idde90e50f3effcca81b65d13b0dc098a7dea2d03
Reviewed-on: http://review.typo3.org/41824
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Frederic Gaus <frederic.gaus@flagbit.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
25 files changed:
typo3/sysext/backend/Classes/Sprite/AbstractSpriteHandler.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_1ncsv_hotel.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_1ncsv_offer.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_1ncsv_price.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_1nff_hotel.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_1nff_offer.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_1nff_price.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_mnasym_hotel.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_mnasym_hotel_offer_rel.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_mnasym_offer.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_mnasym_price.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_mnattr_hotel.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_mnattr_hotel_offer_rel.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_mnattr_offer.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_mnmmasym_hotel.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_mnmmasym_offer.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_mnmmasym_price.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_mnsym_hotel.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Configuration/TCA/tx_irretutorial_mnsym_hotel_rel.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/ext_tables.php
typo3/sysext/impexp/Tests/Functional/Fixtures/Extensions/impexp_group_files/Configuration/TCA/tx_impexpgroupfiles_item.php
typo3/sysext/rtehtmlarea/Configuration/TCA/tx_rtehtmlarea_acronym.php
typo3/sysext/scheduler/Configuration/TCA/tx_scheduler_task_group.php
typo3/sysext/sys_action/Configuration/TCA/sys_action.php
typo3/sysext/sys_note/Configuration/TCA/sys_note.php

index 3c44a3a..8ec4eb0 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Backend\Sprite;
  */
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\PathUtility;
 
 /**
  * An abstract class implementing SpriteIconGeneratorInterface.
@@ -139,12 +140,19 @@ abstract class AbstractSpriteHandler implements SpriteIconGeneratorInterface {
                                if (isset($tcaCtrl['iconfile'])) {
                                        // In CSS we need a path relative to the css file
                                        // [TCA][ctrl][iconfile] defines icons without path info to reside in gfx/i/
-                                       if (strpos($tcaCtrl['iconfile'], '/') !== FALSE) {
+                                       if (\TYPO3\CMS\Core\Utility\StringUtility::beginsWith($tcaCtrl['iconfile'], 'EXT:')) {
+                                               list($extensionKey, $relativePath) = explode('/', substr($tcaCtrl['iconfile'], 4), 2);
+                                               $pathInfo = PathUtility::pathinfo(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extensionKey) . $relativePath);
+                                               $path = PathUtility::getRelativePathTo($pathInfo['dirname']);
+                                               $icon = $path . $pathInfo['basename'];
+                                       } elseif (strpos($tcaCtrl['iconfile'], '/') !== FALSE) {
                                                $icon = $tcaCtrl['iconfile'];
+                                               $icon = GeneralUtility::resolveBackPath($icon);
                                        } else {
                                                $icon = $skinPath . 'gfx/i/' . $tcaCtrl['iconfile'];
+                                               $icon = GeneralUtility::resolveBackPath($icon);
                                        }
-                                       $icon = GeneralUtility::resolveBackPath($icon);
+
                                        $resultArray['tcarecords-' . $tableName . '-default'] = $icon;
                                }
                                // If records types are available, register them
index 72c362c..45c126d 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_hotel.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_hotel.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
                'shadowColumnsForNewPlaceholders' => 'offers',
index 39923ba..1379936 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_offer.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_offer.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
                'shadowColumnsForNewPlaceholders' => 'prices',
index 207c961..979d583 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_price.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_price.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
        ),
index 40ee146..6a413d0 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_hotel.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_hotel.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
                // @see http://forge.typo3.org/issues/29278 which solves it implicitly in the Core
index ecb56a8..07a311c 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_offer.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_offer.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
                // @see http://forge.typo3.org/issues/29278 which solves it implicitly in the Core
index ae90587..42c4cfb 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_price.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_price.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
                // @see http://forge.typo3.org/issues/29278 which solves it implicitly in the Core
index 5ce69e8..7944128 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_hotel.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_hotel.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
        ),
index 2488106..6125831 100644 (file)
@@ -13,7 +13,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_hotel_offer_rel.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_hotel_offer_rel.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
                // @see http://forge.typo3.org/issues/29278 which solves it implicitly in the Core
index cf1177d..dc896d5 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_offer.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_offer.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
        ),
index efdbc56..9ca8e19 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_price.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_price.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
                // @see http://forge.typo3.org/issues/29278 which solves it implicitly in the Core
index e8d61a3..abbf33b 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_hotel.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_hotel.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
        ),
index a038304..d9646b4 100644 (file)
@@ -13,7 +13,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_hotel_offer_rel.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_hotel_offer_rel.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
                // @see http://forge.typo3.org/issues/29278 which solves it implicitly in the Core
index 8fc9311..eb62d97 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_offer.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_offer.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
        ),
index 1809b5e..ce17d9d 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_hotel.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_hotel.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
        ),
index 4a13c82..010f62b 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_offer.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_offer.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
        ),
index b66edea..8e4521b 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_price.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_price.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
        ),
index f49641c..4dc843c 100644 (file)
@@ -14,7 +14,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_hotel.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_hotel.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
        ),
index 2c0cdd8..4676087 100644 (file)
@@ -13,7 +13,7 @@ return array(
                'enablecolumns' => array(
                        'disabled' => 'hidden',
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('irre_tutorial') . 'Resources/Public/Icons/icon_tx_irretutorial_hotel_rel.gif',
+               'iconfile' => 'EXT:irre_tutorial/Resources/Public/Icons/icon_tx_irretutorial_hotel_rel.gif',
                'versioningWS' => 2,
                'origUid' => 't3_origuid',
                // @see http://forge.typo3.org/issues/29278 which solves it implicitly in the Core
index b946b4e..be27dd0 100644 (file)
@@ -30,7 +30,7 @@ $TCA['tx_blogexample_domain_model_blog'] = array (
                        'fe_group' => 'fe_group',
                ),
                'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/Blog.php',
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/icon_tx_blogexample_domain_model_blog.gif'
+               'iconfile' => 'EXT:blog_example/Resources/Public/Icons/icon_tx_blogexample_domain_model_blog.gif'
        )
 );
 
@@ -54,7 +54,7 @@ $TCA['tx_blogexample_domain_model_post'] = array (
                        'disabled' => 'hidden'
                ),
                'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/Post.php',
-               'iconfile'   => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/icon_tx_blogexample_domain_model_post.gif'
+               'iconfile' => 'EXT:blog_example/Resources/Public/Icons/icon_tx_blogexample_domain_model_post.gif'
        )
 );
 
@@ -72,7 +72,7 @@ $TCA['tx_blogexample_domain_model_comment'] = array (
                        'disabled' => 'hidden'
                ),
                'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/Comment.php',
-               'iconfile'   => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/icon_tx_blogexample_domain_model_comment.gif'
+               'iconfile' => 'EXT:blog_example/Resources/Public/Icons/icon_tx_blogexample_domain_model_comment.gif'
        )
 );
 
@@ -94,7 +94,7 @@ $TCA['tx_blogexample_domain_model_person'] = array (
                        'disabled' => 'hidden'
                        ),
                'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/Person.php',
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/icon_tx_blogexample_domain_model_person.gif'
+               'iconfile' => 'EXT:blog_example/Resources/Public/Icons/icon_tx_blogexample_domain_model_person.gif'
        )
 );
 
@@ -110,7 +110,7 @@ $TCA['tx_blogexample_domain_model_tag'] = array (
                        'disabled' => 'hidden'
                ),
                'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/Tag.php',
-               'iconfile'   => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/icon_tx_blogexample_domain_model_tag.gif'
+               'iconfile' => 'EXT:blog_example/Resources/Public/Icons/icon_tx_blogexample_domain_model_tag.gif'
        )
 );
 
index 7daf818..6e39d5b 100644 (file)
@@ -22,7 +22,7 @@ return array(
                        'endtime' => 'endtime',
                ),
                'searchFields' => 'price,currency,symbol,',
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('impexp_group_files') . 'Resources/Public/Icons/icon_tx_impexpgroupfiles_item.gif'
+               'iconfile' => 'EXT:impexp_group_files/Resources/Public/Icons/icon_tx_impexpgroupfiles_item.gif'
        ),
        'interface' => array(
                'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, images, image_references, flexform',
index bebcdac..d3e4796 100644 (file)
@@ -11,7 +11,7 @@ return array(
                        'starttime' => 'starttime',
                        'endtime' => 'endtime'
                ),
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('rtehtmlarea') . 'Resources/Public/Images/Plugins/Abbreviation/abbreviation.gif'
+               'iconfile' => 'EXT:rtehtmlarea/Resources/Public/Images/Plugins/Abbreviation/abbreviation.gif'
        ),
        'interface' => array(
                'showRecordFieldList' => 'hidden,sys_language_uid,term,acronym'
index e0c832f..4e32637 100644 (file)
@@ -8,7 +8,7 @@ return array(
                'cruser_id' => 'cruser_id',
                'delete' => 'deleted',
                'sortby' => 'sorting',
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('scheduler') . 'ext_icon.png',
+               'iconfile' => 'EXT:scheduler/ext_icon.png',
                'adminOnly' => 1, // Only admin users can edit
                'rootLevel' => 1,
                'enablecolumns' => array(
index b886758..811e283 100644 (file)
@@ -20,7 +20,7 @@ return array(
                        'default' => 'mimetypes-x-sys_action'
                ),
                'type' => 'type',
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('sys_action') . 'Resources/Public/Images/x-sys_action.png',
+               'iconfile' => 'EXT:sys_action/Resources/Public/Images/x-sys_action.png',
        ),
        'interface' => array(
                'showRecordFieldList' => 'hidden,title,type,description,assign_to_groups'
index a5f4eb8..774f247 100644 (file)
@@ -9,7 +9,7 @@ return array(
                'prependAtCopy' => 'LLL:EXT:lang/locallang_general.xlf:LGL.prependAtCopy',
                'delete' => 'deleted',
                'title' => 'LLL:EXT:sys_note/Resources/Private/Language/locallang_tca.xlf:sys_note',
-               'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('sys_note') . 'ext_icon.png',
+               'iconfile' => 'EXT:sys_note/ext_icon.png',
                'sortby' => 'sorting',
        ),
        'interface' => array(