[TASK] Add possibility to register a module as navigation 93/30593/4
authorHelmut Hummel <helmut.hummel@typo3.org>
Thu, 5 Jun 2014 15:00:18 +0000 (17:00 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 21 Jun 2014 14:56:03 +0000 (16:56 +0200)
While implementing CSRF protection for backend modules,
it was forgotten to implement a solution for navigation components
that also could be modules.

Add this possibility now by introducing yet another
configuration option for modules.

Resolves: #58138
Documentation: #59369
Releases: 6.3, 6.2
Change-Id: I6655ad11cbf8a13c7d1182c9635cf2745183fb49
Reviewed-on: https://review.typo3.org/30593
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Frans Saris
Tested-by: Frans Saris
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/backend/Classes/View/ModuleMenuView.php

index 212261f..d9bfc8d 100644 (file)
@@ -245,6 +245,16 @@ 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'];
+                                       }
                                        $modules[$moduleKey]['subitems'][$submoduleKey] = array(
                                                'name' => $moduleName . '_' . $submoduleName,
                                                'title' => $GLOBALS['LANG']->moduleLabels['tabs'][$submoduleKey],
@@ -253,7 +263,7 @@ class ModuleMenuView {
                                                'link' => $submoduleLink,
                                                'originalLink' => $originalLink,
                                                'description' => $submoduleDescription,
-                                               'navigationFrameScript' => $submoduleData['navFrameScript'],
+                                               'navigationFrameScript' => $navigationFrameScript,
                                                'navigationFrameScriptParam' => $submoduleData['navFrameScriptParam'],
                                                'navigationComponentId' => $submoduleData['navigationComponentId']
                                        );