[TASK] Replace $GLOBALS[‘LANG’] with local property in ext:aboutmodules 97/37297/2
authorMichael Oehlhof <typo3@oehlhof.de>
Thu, 26 Feb 2015 21:59:52 +0000 (22:59 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 26 Feb 2015 22:50:02 +0000 (23:50 +0100)
The local property languageService was only used in the indexAction.
In getModulesData and getSubModuleData there was still $GLOBALS[‘LANG’]
used, which is now changed to the local property languageService.

Resolves: #65368
Releases: master
Change-Id: Ibae1f34b7baa37d5693bdb8220f59c23c5bbac0c
Reviewed-on: http://review.typo3.org/37297
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/aboutmodules/Classes/Controller/ModulesController.php

index dcd01ad..5d2c20e 100644 (file)
@@ -104,7 +104,7 @@ class ModulesController extends ActionController {
                        $mainModuleData = array();
                        $moduleKey = $moduleName . '_tab';
                        $mainModuleData['name'] = $moduleName;
-                       $mainModuleData['label'] = $GLOBALS['LANG']->moduleLabels['tabs'][$moduleKey];
+                       $mainModuleData['label'] = $this->languageService->moduleLabels['tabs'][$moduleKey];
                        if (is_array($moduleInfo['sub']) && count($moduleInfo['sub']) > 0) {
                                $mainModuleData['subModules'] = $this->getSubModuleData($moduleName, $moduleInfo['sub']);
                        }
@@ -126,10 +126,10 @@ class ModulesController extends ActionController {
                        $subModuleKey = $moduleName . '_' . $subModuleName . '_tab';
                        $subModuleData = array();
                        $subModuleData['name'] = $subModuleName;
-                       $subModuleData['icon'] = PathUtility::stripPathSitePrefix($GLOBALS['LANG']->moduleLabels['tabs_images'][$subModuleKey]);
-                       $subModuleData['label'] = $GLOBALS['LANG']->moduleLabels['tabs'][$subModuleKey];
-                       $subModuleData['shortDescription'] = $GLOBALS['LANG']->moduleLabels['labels'][$subModuleKey . 'label'];
-                       $subModuleData['longDescription'] = $GLOBALS['LANG']->moduleLabels['labels'][$subModuleKey . 'descr'];
+                       $subModuleData['icon'] = PathUtility::stripPathSitePrefix($this->languageService->moduleLabels['tabs_images'][$subModuleKey]);
+                       $subModuleData['label'] = $this->languageService->moduleLabels['tabs'][$subModuleKey];
+                       $subModuleData['shortDescription'] = $this->languageService->moduleLabels['labels'][$subModuleKey . 'label'];
+                       $subModuleData['longDescription'] = $this->languageService->moduleLabels['labels'][$subModuleKey . 'descr'];
                        $subModulesData[] = $subModuleData;
                }
                return $subModulesData;