[TASK] Cleanup navigation frame module registration 56/42856/5
authorHelmut Hummel <helmut.hummel@typo3.org>
Mon, 24 Aug 2015 14:06:47 +0000 (16:06 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Mon, 24 Aug 2015 20:52:33 +0000 (22:52 +0200)
http://review.typo3.org/37611 made the navigation frame dispatched.
For this it leveraged the addNavigationComponent API,
which was introduced only for ExtJS tree components.

Since we want to get rid of ExtJS (and this API specifically),
we need to introduce a different way to make modules or routes
navigation components.

This change reverts the above changes to the API and instead uses
the `navigationFrameModule` option which was introduced in
https://review.typo3.org/#/c/30593

To make this option work with top level modules and inheritance of
the navigation frame,
the evaluation of the option is moved to the module loader, which
has the benefit to have the code only in one place while it needed
to be in two places before.

Resolves: #69270
Releases: master
Change-Id: I7cb2ca2ee6d04001af424c88a1db828d1712caa1
Reviewed-on: http://review.typo3.org/42856
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php
typo3/sysext/backend/Classes/Module/ModuleLoader.php
typo3/sysext/backend/Classes/View/ModuleMenuView.php
typo3/sysext/backend/ext_tables.php
typo3/sysext/core/ext_tables.php

index c841a66..a3e2542 100644 (file)
@@ -270,16 +270,7 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface {
                                        $submoduleKey = $moduleName . '_' . $submoduleName . '_tab';
                                        $submoduleDescription = $GLOBALS['LANG']->moduleLabels['labels'][$submoduleKey . 'label'];
                                        $originalLink = $submoduleLink;
-                                       if (isset($submoduleData['navigationFrameModule'])) {
-                                               $navigationFrameScript = BackendUtility::getModuleUrl(
-                                                       $submoduleData['navigationFrameModule'],
-                                                       isset($submoduleData['navigationFrameModuleParameters'])
-                                                               ? $submoduleData['navigationFrameModuleParameters']
-                                                               : array()
-                                               );
-                                       } else {
-                                               $navigationFrameScript = $submoduleData['navFrameScript'];
-                                       }
+                                       $navigationFrameScript = $submoduleData['navFrameScript'];
                                        $modules[$moduleKey]['subitems'][$submoduleKey] = array(
                                                'name' => $moduleName . '_' . $submoduleName,
                                                'title' => $GLOBALS['LANG']->moduleLabels['tabs'][$submoduleKey],
index d48b8a4..27ec58e 100644 (file)
@@ -318,18 +318,24 @@ class ModuleLoader {
                        $finalModuleConfiguration['script'] = BackendUtility::getModuleUrl('dummy');
                }
 
-               // Navigation Frame Script (GET params could be added)
-               if ($setupInformation['configuration']['navFrameScript']) {
+               if (!empty($setupInformation['configuration']['navigationFrameModule'])) {
+                       $finalModuleConfiguration['navFrameScript'] = BackendUtility::getModuleUrl(
+                               $setupInformation['configuration']['navigationFrameModule'],
+                               !empty($setupInformation['configuration']['navigationFrameModuleParameters'])
+                                       ? $setupInformation['configuration']['navigationFrameModuleParameters']
+                                       : array()
+                       );
+               } elseif (!empty($setupInformation['configuration']['navFrameScript'])) {
+                       // Navigation Frame Script (GET params could be added)
                        $navFrameScript = explode('?', $setupInformation['configuration']['navFrameScript']);
                        $navFrameScript = $navFrameScript[0];
                        if (file_exists($setupInformation['path'] . '/' . $navFrameScript)) {
                                $finalModuleConfiguration['navFrameScript'] = $this->getRelativePath(PATH_typo3, $fullPath . '/' . $setupInformation['configuration']['navFrameScript']);
                        }
-               }
-
-               // additional params for Navigation Frame Script: "&anyParam=value&moreParam=1"
-               if ($setupInformation['configuration']['navFrameScriptParam']) {
-                       $finalModuleConfiguration['navFrameScriptParam'] = $setupInformation['configuration']['navFrameScriptParam'];
+                       // Additional params for Navigation Frame Script: "&anyParam=value&moreParam=1"
+                       if ($setupInformation['configuration']['navFrameScriptParam']) {
+                               $finalModuleConfiguration['navFrameScriptParam'] = $setupInformation['configuration']['navFrameScriptParam'];
+                       }
                }
 
                // Check if this is a submodule
@@ -340,20 +346,10 @@ class ModuleLoader {
 
                // check if there is a navigation component (like the pagetree)
                if (is_array($this->navigationComponents[$name])) {
-                       // the navigation component is a module, so the module URL is taken
-                       if (isset($GLOBALS['TBE_MODULES']['_PATHS'][$this->navigationComponents[$name]['componentId']])) {
-                               $finalModuleConfiguration['navFrameScript'] = BackendUtility::getModuleUrl($this->navigationComponents[$name]['componentId']);
-                       } else {
-                               $finalModuleConfiguration['navigationComponentId'] = $this->navigationComponents[$name]['componentId'];
-                       }
+                       $finalModuleConfiguration['navigationComponentId'] = $this->navigationComponents[$name]['componentId'];
                // navigation component can be overriden by the main module component
                } elseif ($mainModule && is_array($this->navigationComponents[$mainModule]) && $setupInformation['configuration']['inheritNavigationComponentFromMainModule'] !== FALSE) {
-                       // the navigation component is a module, so the module URL is taken
-                       if (isset($GLOBALS['TBE_MODULES']['_PATHS'][$this->navigationComponents[$mainModule]['componentId']])) {
-                               $finalModuleConfiguration['navFrameScript'] = BackendUtility::getModuleUrl($this->navigationComponents[$mainModule]['componentId']);
-                       } else {
-                               $finalModuleConfiguration['navigationComponentId'] = $this->navigationComponents[$mainModule]['componentId'];
-                       }
+                       $finalModuleConfiguration['navigationComponentId'] = $this->navigationComponents[$mainModule]['componentId'];
                }
                return $finalModuleConfiguration;
        }
index 39b29c5..d7d6fcf 100644 (file)
@@ -242,16 +242,7 @@ class ModuleMenuView {
                                        $submoduleIcon = $this->getModuleIcon($submoduleKey);
                                        $submoduleDescription = $GLOBALS['LANG']->moduleLabels['labels'][$submoduleKey . 'label'];
                                        $originalLink = $submoduleLink;
-                                       if (isset($submoduleData['navigationFrameModule'])) {
-                                               $navigationFrameScript = BackendUtility::getModuleUrl(
-                                                       $submoduleData['navigationFrameModule'],
-                                                       isset($submoduleData['navigationFrameModuleParameters'])
-                                                               ? $submoduleData['navigationFrameModuleParameters']
-                                                               : array()
-                                               );
-                                       } else {
-                                               $navigationFrameScript = $submoduleData['navFrameScript'];
-                                       }
+                                       $navigationFrameScript = $submoduleData['navFrameScript'];
                                        $modules[$moduleKey]['subitems'][$submoduleKey] = array(
                                                'name' => $moduleName . '_' . $submoduleName,
                                                'title' => $GLOBALS['LANG']->moduleLabels['tabs'][$submoduleKey],
index cac7810..9ab59ff 100644 (file)
@@ -4,7 +4,6 @@ defined('TYPO3_MODE') or die();
 if (TYPO3_MODE === 'BE') {
 
        // Register file_navframe
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addCoreNavigationComponent('file', 'file_navframe');
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
                'file_navframe',
                'EXT:backend/Modules/FileSystemNavigationFrame/'
index 65483ea..340d54e 100644 (file)
@@ -74,6 +74,7 @@ $GLOBALS['TBE_MODULES'] = array(
                        'labels' => array(
                                'll_ref' => 'LLL:EXT:lang/locallang_mod_file.xlf'
                        ),
+                       'navigationFrameModule' => 'file_navframe',
                        'configuration' => array(
                                'name' => 'file',
                                'access' => 'user,group',