[!!!][TASK] Fix configuration for backend module icons 54/42854/6
authorHelmut Hummel <helmut.hummel@typo3.org>
Mon, 24 Aug 2015 13:45:23 +0000 (15:45 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 25 Aug 2015 06:31:16 +0000 (08:31 +0200)
http://review.typo3.org/38004 removed the typo3/mod directory
with the main modules and their configuration and added the configuration
to `$GLOBALS['TBE_MODULES']`directly.
However for that a sub array key `configuration` was used, which is
inconsistent with all our current API and its usages across other
modules, leading to the situation that this configuration was basically
ignored.

On top of that, http://review.typo3.org/39316 introduced the possibility
to use sprite icons as module icons, which used the configuration key
`icon` in the above mentioned sub array key `configuration`,
making this key the only option evaluated in the sub array.

This change removes this sub array and moves the sprite icon
configuration on top for consistency. For that the key must be changed
to 'iconIdentifier' as 'icon' was already taken for Extbase module
icon configuration.

Resolves: #69291
Releases: master
Change-Id: I282841fdb09c9c2773ca6e5518fdda863f9f8ef5
Reviewed-on: http://review.typo3.org/42854
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php
typo3/sysext/core/Documentation/Changelog/7.3/Feature-66822-SpriteIconsInBackendModules.rst
typo3/sysext/core/Documentation/Changelog/master/Breaking-69291-ChangedRegistrationOfBackendModuleIcons.rst [new file with mode: 0644]
typo3/sysext/core/ext_tables.php

index a3e2542..3536746 100644 (file)
@@ -336,8 +336,8 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface {
                $icon = '';
 
                // add as a sprite icon
-               if ($moduleData['configuration']['icon']) {
-                       $icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon($moduleData['configuration']['icon'], array('tagName' => 'i'));
+               if (!empty($moduleData['iconIdentifier'])) {
+                       $icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon($moduleData['iconIdentifier'], array('tagName' => 'i'));
                } elseif (!empty($GLOBALS['LANG']->moduleLabels['tabs_images'][$moduleKey])) {
                        $imageReference = $GLOBALS['LANG']->moduleLabels['tabs_images'][$moduleKey];
                        $iconFileRelative = $this->getModuleIconRelative($imageReference);
index b6d0866..2333740 100644 (file)
@@ -21,9 +21,7 @@ Registering a module can now look like this (as an example the "Page" module):
                        'script' => '_DISPATCH',
                        'access' => 'user,group',
                        'name' => 'web_layout',
-                       'configuration' => array(
-                               'icon' => 'module-web',
-                       ),
+                       'iconIdentifier' => 'module-web',
                        'labels' => array(
                                'll_ref' => 'LLL:EXT:backend/Resources/Private/Language/locallang_mod.xlf',
                        ),
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-69291-ChangedRegistrationOfBackendModuleIcons.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-69291-ChangedRegistrationOfBackendModuleIcons.rst
new file mode 100644 (file)
index 0000000..dbaba1e
--- /dev/null
@@ -0,0 +1,39 @@
+===============================================================
+Breaking: #69291 - Changed registration of backend module icons
+===============================================================
+
+Description
+===========
+
+The sprite icon support for backend modules introduced with CMS 7.3 has been adjusted again. The configuration has been streamlined.
+
+
+Impact
+======
+
+The specified icon will not be recognized.
+
+
+Affected Installations
+======================
+
+Any installation running TYPO3 CMS 7.3+ having third party extensions which use sprite icons for backend modules.
+
+
+Migration
+=========
+
+Change the configuration from
+
+.. code-block:: php
+
+       'configuration' => array(
+               'icon' => 'module-web',
+       ),
+
+to
+
+.. code-block:: php
+
+       'iconIdentifier' => 'module-web',
+
index 340d54e..974f46f 100644 (file)
@@ -64,62 +64,50 @@ $GLOBALS['TBE_MODULES'] = array(
                        'labels' => array(
                                'll_ref' => 'LLL:EXT:lang/locallang_mod_web.xlf'
                        ),
-                       'configuration' => array(
-                               'name' => 'web',
-                               'access' => 'user,group',
-                               'icon' => 'module-web'
-                       )
+                       'name' => 'web',
+                       'access' => 'user,group',
+                       'iconIdentifier' => 'module-web'
                ),
                'file' => array(
                        'labels' => array(
                                'll_ref' => 'LLL:EXT:lang/locallang_mod_file.xlf'
                        ),
                        'navigationFrameModule' => 'file_navframe',
-                       'configuration' => array(
-                               'name' => 'file',
-                               'access' => 'user,group',
-                               'workspaces' => 'online,custom',
-                               'icon' => 'module-file'
-                       )
+                       'name' => 'file',
+                       'access' => 'user,group',
+                       'workspaces' => 'online,custom',
+                       'iconIdentifier' => 'module-file'
                ),
                'user' => array(
                        'labels' => array(
                                'll_ref' => 'LLL:EXT:lang/locallang_mod_usertools.xlf'
                        ),
-                       'configuration' => array(
-                               'name' => 'user',
-                               'access' => 'user,group',
-                               'icon' => 'status-user-backend'
-                       )
+                       'name' => 'user',
+                       'access' => 'user,group',
+                       'iconIdentifier' => 'status-user-backend'
                ),
                'tools' => array(
                        'labels' => array(
                                'll_ref' => 'LLL:EXT:lang/locallang_mod_admintools.xlf'
                        ),
-                       'configuration' => array(
-                               'name' => 'tools',
-                               'access' => 'admin',
-                               'icon' => 'module-tools'
-                       )
+                       'name' => 'tools',
+                       'access' => 'admin',
+                       'iconIdentifier' => 'module-tools'
                ),
                'system' => array(
                        'labels' => array(
                                'll_ref' => 'LLL:EXT:lang/locallang_mod_system.xlf'
                        ),
-                       'configuration' => array(
-                               'name' => 'system',
-                               'access' => 'admin',
-                               'icon' => 'module-system'
-                       )
+                       'name' => 'system',
+                       'access' => 'admin',
+                       'iconIdentifier' => 'module-system'
                ),
                'help' => array(
                        'labels' => array(
                                'll_ref' => 'LLL:EXT:lang/locallang_mod_help.xlf'
                        ),
-                       'configuration' => array(
-                               'name' => 'help',
-                               'icon' => 'module-help'
-                       )
+                       'name' => 'help',
+                       'iconIdentifier' => 'module-help'
                )
        )
 );