[TASK] Streamline JavaScript calls to ModuleMenu reload 88/45088/2
authorBenni Mack <benni@typo3.org>
Wed, 2 Dec 2015 13:45:11 +0000 (14:45 +0100)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 4 Dec 2015 22:44:23 +0000 (23:44 +0100)
There are several versions (partly legacy) of how to
trigger a reload of the Module Menu. This is now
streamlined.

Additionally the NewContentElementController does
not reload the module menu anymore on loading.

Resolves: #72024
Releases: master
Change-Id: I58fc274f22d0312b0616e20e379225f77540fbb3
Reviewed-on: https://review.typo3.org/45088
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Resources/Public/JavaScript/modulemenu.js
typo3/sysext/extensionmanager/Classes/ViewHelpers/Be/TriggerViewHelper.php
typo3/sysext/setup/Classes/Controller/SetupModuleController.php

index 603e788..3ec0746 100644 (file)
@@ -239,14 +239,8 @@ class NewContentElementController extends AbstractModule
             $this->moduleTemplate->addJavaScriptCode(
                 'NewContentElementWizardInlineJavascript',
                 '
-                               function goToalt_doc() {        //
+                               function goToalt_doc() {
                                        ' . $this->onClickEvent . '
-                               }
-
-                               if(top.refreshMenu) {
-                                       top.refreshMenu();
-                               } else {
-                                       top.TYPO3ModuleMenu.refreshMenu();
                                }'
             );
 
index 257ce59..fe16962 100644 (file)
@@ -261,6 +261,7 @@ Ext.onReady(function() {
        top.list_frame = top.list.getIframe();
        top.nav_frame = TYPO3.Backend.NavigationContainer.PageTree;
 
+       // not in use anymore
        top.TYPO3ModuleMenu = TYPO3.ModuleMenu.App;
        top.content = {
                nav_frame: TYPO3.Backend.NavigationContainer.PageTree,
index e1809d5..6bbb946 100644 (file)
@@ -49,7 +49,7 @@ class TriggerViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendV
         if (!empty($triggers[AbstractController::TRIGGER_RefreshModuleMenu])) {
             $pageRenderer->addJsInlineCode(
                 AbstractController::TRIGGER_RefreshModuleMenu,
-                'if (top.TYPO3ModuleMenu.refreshMenu) { top.TYPO3ModuleMenu.refreshMenu(); }'
+                'if (top && top.TYPO3.ModuleMenu.App) { top.TYPO3.ModuleMenu.App.refreshMenu(); }'
             );
         }
         return '';
index 7d8b02e..ef9130a 100644 (file)
@@ -366,10 +366,8 @@ class SetupModuleController extends AbstractModule
         $this->content .= '<form action="' . BackendUtility::getModuleUrl('user_setup') . '" method="post" id="SetupModuleController" name="usersetup" enctype="multipart/form-data">';
         if ($this->languageUpdate) {
             $this->moduleTemplate->addJavaScriptCode('languageUpdate', '
-                if (top.refreshMenu) {
-                    top.refreshMenu();
-                } else {
-                    top.TYPO3ModuleMenu.refreshMenu();
+                if (top && top.TYPO3.ModuleMenu.App) {
+                    top.TYPO3.ModuleMenu.App.refreshMenu();
                 }
             ');
         }