From 364c7a34f6388e5290f0065d26474ee3833cf7e5 Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Sun, 6 Mar 2016 03:38:13 +0100
Subject: [PATCH] [TASK] Use simple syntax for labels in module registration

Resolves: #74363
Releases: master
Change-Id: Ic9cd97f5b1dc6654020782e91a49330fb4bfcfbe
Reviewed-on: https://review.typo3.org/47134
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
---
 .../backend/Classes/Module/ModuleLoader.php   |  2 +-
 typo3/sysext/backend/ext_tables.php           |  4 +---
 ...onConfigurationViaLabelstabs_imagestab.rst |  6 ++---
 typo3/sysext/core/ext_tables.php              | 24 +++++--------------
 typo3/sysext/dbal/ext_tables.php              |  4 +---
 typo3/sysext/func/ext_tables.php              |  4 +---
 typo3/sysext/info/ext_tables.php              |  4 +---
 typo3/sysext/install/ext_tables.php           |  4 +---
 typo3/sysext/lowlevel/ext_tables.php          |  8 ++-----
 typo3/sysext/recordlist/ext_tables.php        |  4 +---
 typo3/sysext/scheduler/ext_tables.php         |  4 +---
 typo3/sysext/setup/ext_tables.php             |  4 +---
 typo3/sysext/taskcenter/ext_tables.php        |  4 +---
 typo3/sysext/tstemplate/ext_tables.php        |  4 +---
 14 files changed, 21 insertions(+), 59 deletions(-)

diff --git a/typo3/sysext/backend/Classes/Module/ModuleLoader.php b/typo3/sysext/backend/Classes/Module/ModuleLoader.php
index 5e969c7ec63b..dfc1806ce780 100644
--- a/typo3/sysext/backend/Classes/Module/ModuleLoader.php
+++ b/typo3/sysext/backend/Classes/Module/ModuleLoader.php
@@ -173,7 +173,7 @@ class ModuleLoader
         $finalModuleConfiguration = $setupInformation['configuration'];
         $finalModuleConfiguration['name'] = $name;
         // Language processing. This will add module labels and image reference to the internal ->moduleLabels array of the LANG object.
-        $this->addLabelsForModule($name, $setupInformation['labels']);
+        $this->addLabelsForModule($name, ($finalModuleConfiguration['labels'] ?? $setupInformation['labels']));
 
         // Default script setup
         if ($setupInformation['configuration']['script'] === '_DISPATCH' || isset($setupInformation['configuration']['routeTarget'])) {
diff --git a/typo3/sysext/backend/ext_tables.php b/typo3/sysext/backend/ext_tables.php
index 87d03b3f6779..e5d39f7f65a1 100644
--- a/typo3/sysext/backend/ext_tables.php
+++ b/typo3/sysext/backend/ext_tables.php
@@ -12,9 +12,7 @@ if (TYPO3_MODE === 'BE') {
             'access' => 'user,group',
             'name' => 'web_layout',
             'icon' => 'EXT:backend/Resources/Public/Icons/module-page.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:backend/Resources/Private/Language/locallang_mod.xlf',
-            ),
+            'labels' => 'LLL:EXT:backend/Resources/Private/Language/locallang_mod.xlf'
         )
     );
 
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-72827-ModuleIconConfigurationViaLabelstabs_imagestab.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-72827-ModuleIconConfigurationViaLabelstabs_imagestab.rst
index 5f2ac7e81308..2e20cc499cc6 100644
--- a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-72827-ModuleIconConfigurationViaLabelstabs_imagestab.rst
+++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-72827-ModuleIconConfigurationViaLabelstabs_imagestab.rst
@@ -43,8 +43,6 @@ Replace the ``[labels][tabs_images][tab]`` with ``[icon]`` in ``ext_tables.php``
             'name' => 'system_dbint',
             'workspaces' => 'online',
             'icon' => 'EXT:lowlevel/Resources/Public/Icons/module-dbint.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:lowlevel/Resources/Private/Language/locallang_mod.xlf',
-            ),
+            'labels' => 'LLL:EXT:lowlevel/Resources/Private/Language/locallang_mod.xlf'
         )
-    );
\ No newline at end of file
+    );
diff --git a/typo3/sysext/core/ext_tables.php b/typo3/sysext/core/ext_tables.php
index 53be2108398a..1a5fced4019b 100644
--- a/typo3/sysext/core/ext_tables.php
+++ b/typo3/sysext/core/ext_tables.php
@@ -61,46 +61,34 @@ $GLOBALS['TBE_MODULES'] = array(
     'help' => '',
     '_configuration' => array(
         'web' => array(
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:lang/locallang_mod_web.xlf'
-            ),
+            'labels' => 'LLL:EXT:lang/locallang_mod_web.xlf',
             'name' => 'web',
             'iconIdentifier' => 'module-web'
         ),
         'file' => array(
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:lang/locallang_mod_file.xlf'
-            ),
+            'labels' => 'LLL:EXT:lang/locallang_mod_file.xlf',
             'navigationFrameModule' => 'file_navframe',
             'name' => 'file',
             'workspaces' => 'online,custom',
             'iconIdentifier' => 'module-file'
         ),
         'user' => array(
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:lang/locallang_mod_usertools.xlf'
-            ),
+            'labels' => 'LLL:EXT:lang/locallang_mod_usertools.xlf',
             'name' => 'user',
             'iconIdentifier' => 'status-user-backend'
         ),
         'tools' => array(
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:lang/locallang_mod_admintools.xlf'
-            ),
+            'labels' => 'LLL:EXT:lang/locallang_mod_admintools.xlf',
             'name' => 'tools',
             'iconIdentifier' => 'module-tools'
         ),
         'system' => array(
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:lang/locallang_mod_system.xlf'
-            ),
+            'labels' => 'LLL:EXT:lang/locallang_mod_system.xlf',
             'name' => 'system',
             'iconIdentifier' => 'module-system'
         ),
         'help' => array(
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:lang/locallang_mod_help.xlf'
-            ),
+            'labels' => 'LLL:EXT:lang/locallang_mod_help.xlf',
             'name' => 'help',
             'iconIdentifier' => 'module-help'
         )
diff --git a/typo3/sysext/dbal/ext_tables.php b/typo3/sysext/dbal/ext_tables.php
index 880c6b402584..872923716ec2 100644
--- a/typo3/sysext/dbal/ext_tables.php
+++ b/typo3/sysext/dbal/ext_tables.php
@@ -12,9 +12,7 @@ if (TYPO3_MODE === 'BE') {
             'access' => 'admin',
             'name' => 'tools_txdbalM1',
             'icon' => 'EXT:dbal/Resources/Public/Icons/module-dbal.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:dbal/Resources/Private/Language/locallang_mod.xlf',
-            ),
+            'labels' => 'LLL:EXT:dbal/Resources/Private/Language/locallang_mod.xlf'
         )
     );
 }
diff --git a/typo3/sysext/func/ext_tables.php b/typo3/sysext/func/ext_tables.php
index a3ddb703fc8d..02b6f7de3c0f 100644
--- a/typo3/sysext/func/ext_tables.php
+++ b/typo3/sysext/func/ext_tables.php
@@ -12,9 +12,7 @@ if (TYPO3_MODE === 'BE') {
             'access' => 'user,group',
             'name' => 'web_func',
             'icon' => 'EXT:func/Resources/Public/Icons/module-func.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:lang/locallang_mod_web_func.xlf',
-            ),
+            'labels' => 'LLL:EXT:lang/locallang_mod_web_func.xlf'
         )
     );
 }
diff --git a/typo3/sysext/info/ext_tables.php b/typo3/sysext/info/ext_tables.php
index 1b83637f3dae..41714a09a1c0 100644
--- a/typo3/sysext/info/ext_tables.php
+++ b/typo3/sysext/info/ext_tables.php
@@ -12,9 +12,7 @@ if (TYPO3_MODE === 'BE') {
             'access' => 'user,group',
             'name' => 'web_info',
             'icon' => 'EXT:info/Resources/Public/Icons/module-info.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:lang/locallang_mod_web_info.xlf',
-            ),
+            'labels' => 'LLL:EXT:lang/locallang_mod_web_info.xlf'
         )
     );
 }
diff --git a/typo3/sysext/install/ext_tables.php b/typo3/sysext/install/ext_tables.php
index 58fa1dbf38bf..386905568c21 100644
--- a/typo3/sysext/install/ext_tables.php
+++ b/typo3/sysext/install/ext_tables.php
@@ -21,9 +21,7 @@ if (TYPO3_MODE === 'BE') {
             'access' => 'admin',
             'name' => 'system_extinstall',
             'icon' => 'EXT:install/Resources/Public/Icons/module-install.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:install/Resources/Private/Language/BackendModule.xlf',
-            ),
+            'labels' => 'LLL:EXT:install/Resources/Private/Language/BackendModule.xlf'
         )
     );
 }
diff --git a/typo3/sysext/lowlevel/ext_tables.php b/typo3/sysext/lowlevel/ext_tables.php
index 73736a493379..cf3790753941 100644
--- a/typo3/sysext/lowlevel/ext_tables.php
+++ b/typo3/sysext/lowlevel/ext_tables.php
@@ -13,9 +13,7 @@ if (TYPO3_MODE === 'BE') {
             'name' => 'system_dbint',
             'workspaces' => 'online',
             'icon' => 'EXT:lowlevel/Resources/Public/Icons/module-dbint.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:lowlevel/Resources/Private/Language/locallang_mod.xlf',
-            ),
+            'labels' => 'LLL:EXT:lowlevel/Resources/Private/Language/locallang_mod.xlf'
         )
     );
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
@@ -29,9 +27,7 @@ if (TYPO3_MODE === 'BE') {
             'name' => 'system_config',
             'workspaces' => 'online',
             'icon' => 'EXT:lowlevel/Resources/Public/Icons/module-config.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:lowlevel/Resources/Private/Language/locallang_mod_configuration.xlf',
-            ),
+            'labels' => 'LLL:EXT:lowlevel/Resources/Private/Language/locallang_mod_configuration.xlf'
         )
     );
 }
diff --git a/typo3/sysext/recordlist/ext_tables.php b/typo3/sysext/recordlist/ext_tables.php
index 19dcd17fd9f1..1cd7e7803a67 100644
--- a/typo3/sysext/recordlist/ext_tables.php
+++ b/typo3/sysext/recordlist/ext_tables.php
@@ -12,9 +12,7 @@ if (TYPO3_MODE === 'BE') {
             'access' => 'user,group',
             'name' => 'web_list',
             'icon' => 'EXT:recordlist/Resources/Public/Icons/module-list.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:lang/locallang_mod_web_list.xlf',
-            ),
+            'labels' => 'LLL:EXT:lang/locallang_mod_web_list.xlf'
         )
     );
 
diff --git a/typo3/sysext/scheduler/ext_tables.php b/typo3/sysext/scheduler/ext_tables.php
index 9fa19841cef9..44ca2567122d 100644
--- a/typo3/sysext/scheduler/ext_tables.php
+++ b/typo3/sysext/scheduler/ext_tables.php
@@ -13,9 +13,7 @@ if (TYPO3_MODE === 'BE') {
             'access' => 'admin',
             'name' => 'system_txschedulerM1',
             'icon' => 'EXT:scheduler/Resources/Public/Icons/module-scheduler.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:scheduler/Resources/Private/Language/locallang_mod.xlf',
-            ),
+            'labels' => 'LLL:EXT:scheduler/Resources/Private/Language/locallang_mod.xlf'
         )
     );
 
diff --git a/typo3/sysext/setup/ext_tables.php b/typo3/sysext/setup/ext_tables.php
index 117a59521a1f..a784569fd5d0 100644
--- a/typo3/sysext/setup/ext_tables.php
+++ b/typo3/sysext/setup/ext_tables.php
@@ -12,9 +12,7 @@ if (TYPO3_MODE === 'BE') {
             'access' => 'group,user',
             'name' => 'user_setup',
             'icon' => 'EXT:setup/Resources/Public/Icons/module-setup.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:setup/Resources/Private/Language/locallang_mod.xlf',
-            ),
+            'labels' => 'LLL:EXT:setup/Resources/Private/Language/locallang_mod.xlf'
         )
     );
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
diff --git a/typo3/sysext/taskcenter/ext_tables.php b/typo3/sysext/taskcenter/ext_tables.php
index 6ba59ccd03ec..5b0150083a2a 100644
--- a/typo3/sysext/taskcenter/ext_tables.php
+++ b/typo3/sysext/taskcenter/ext_tables.php
@@ -12,9 +12,7 @@ if (TYPO3_MODE === 'BE') {
             'access' => 'group,user',
             'name' => 'user_task',
             'icon' => 'EXT:taskcenter/Resources/Public/Icons/module-taskcenter.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:taskcenter/Resources/Private/Language/locallang_mod.xlf',
-            ),
+            'labels' => 'LLL:EXT:taskcenter/Resources/Private/Language/locallang_mod.xlf'
         )
     );
 }
diff --git a/typo3/sysext/tstemplate/ext_tables.php b/typo3/sysext/tstemplate/ext_tables.php
index d12e8ede53a8..7a4124669e62 100644
--- a/typo3/sysext/tstemplate/ext_tables.php
+++ b/typo3/sysext/tstemplate/ext_tables.php
@@ -12,9 +12,7 @@ if (TYPO3_MODE === 'BE') {
             'access' => 'admin',
             'name' => 'web_ts',
             'icon' => 'EXT:tstemplate/Resources/Public/Icons/module-tstemplate.svg',
-            'labels' => array(
-                'll_ref' => 'LLL:EXT:tstemplate/Resources/Private/Language/locallang_mod.xlf',
-            ),
+            'labels' => 'LLL:EXT:tstemplate/Resources/Private/Language/locallang_mod.xlf'
         )
     );
 
-- 
GitLab