[BUGFIX] Implement EXT: usage in addModule 92/41692/5
authorWouter Wolters <typo3@wouterwolters.nl>
Sat, 18 Jul 2015 12:30:42 +0000 (14:30 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Mon, 20 Jul 2015 15:33:58 +0000 (17:33 +0200)
Make it possible to use EXT: for resolving paths in addModule

Resolves: #68341
Releases: master, 6.2
Change-Id: Ic26d410f09303baa4fa18c744b30ee72ada09227
Reviewed-on: http://review.typo3.org/41692
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
typo3/sysext/backend/Classes/Module/ModuleLoader.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php

index 92a5677..7f97324 100644 (file)
@@ -263,12 +263,19 @@ class ModuleLoader {
                                                $altIconAbsPath = is_array($GLOBALS['TBE_STYLES']['skinImg'][$altIconKey]) ? GeneralUtility::resolveBackPath(PATH_typo3 . $GLOBALS['TBE_STYLES']['skinImg'][$altIconKey][0]) : '';
                                                // Setting icon, either default or alternative:
                                                if ($altIconAbsPath && @is_file($altIconAbsPath)) {
-                                                       $defaultLabels['tabs_images']['tab'] = $this->getRelativePath(PATH_typo3, $altIconAbsPath);
+                                                       $defaultLabels['tabs_images']['tab'] = $altIconAbsPath;
                                                } else {
                                                        // Setting default icon:
-                                                       $defaultLabels['tabs_images']['tab'] = $this->getRelativePath(PATH_typo3, $fullpath . '/' . $defaultLabels['tabs_images']['tab']);
+                                                       if (substr($defaultLabels['tabs_images']['tab'], 0, 4) === 'EXT:') {
+                                                               list($extensionKey, $relativePath) = explode('/', substr($defaultLabels['tabs_images']['tab'], 4), 2);
+                                                               $defaultLabels['tabs_images']['tab'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extensionKey) . $relativePath;
+                                                       } else {
+                                                               $defaultLabels['tabs_images']['tab'] = $fullpath . '/' . $defaultLabels['tabs_images']['tab'];
+                                                       }
                                                }
 
+                                               $defaultLabels['tabs_images']['tab'] = $this->getRelativePath(PATH_typo3, $defaultLabels['tabs_images']['tab']);
+
                                                // Finally, setting the icon with correct path:
                                                if (substr($defaultLabels['tabs_images']['tab'], 0, 3) == '../') {
                                                        $defaultLabels['tabs_images']['tab'] = PATH_site . substr($defaultLabels['tabs_images']['tab'], 3);
index c4b9eb7..e588039 100644 (file)
@@ -891,6 +891,11 @@ class ExtensionManagementUtility {
                $fullModuleSignature = $main . ($sub ? '_' . $sub : '');
                // Adding path:
                if ($path) {
+                       if (substr($path, 0, 4) === 'EXT:') {
+                               list($extensionKey, $relativePath) = explode('/', substr($path, 4), 2);
+                               $path = self::extPath($extensionKey) . $relativePath;
+                       }
+
                        $GLOBALS['TBE_MODULES']['_PATHS'][$fullModuleSignature] = $path;
                }