[TASK] Load modulemenu as RequireJs module 82/50482/3
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 1 Nov 2016 23:16:10 +0000 (00:16 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 2 Nov 2016 08:48:57 +0000 (09:48 +0100)
Rename the modulemenu JavaScript file to ModuleMenu.js
Load the module with RequireJS in the BackendController.

Resolves: #78538
Releases: master
Change-Id: I2da6a6fd2c3ecdb8cb0fa7267a079c8f6eba1a3d
Reviewed-on: https://review.typo3.org/50482
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Resources/Public/JavaScript/ModuleMenu.js [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/Toolbar.js
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/app.js
typo3/sysext/backend/Resources/Public/JavaScript/modulemenu.js [deleted file]

index aaafd9f..90f541a 100644 (file)
@@ -117,7 +117,6 @@ class BackendController
         $this->jsFiles = [
             'locallang' => $this->getLocalLangFileName(),
             'md5' => 'EXT:backend/Resources/Public/JavaScript/md5.js',
-            'modulemenu' => 'EXT:backend/Resources/Public/JavaScript/modulemenu.js',
             'evalfield' => 'EXT:backend/Resources/Public/JavaScript/jsfunc.evalfield.js',
             'backend' => 'EXT:backend/Resources/Public/JavaScript/backend.js',
             'iframepanel' => 'EXT:backend/Resources/Public/JavaScript/iframepanel.js',
@@ -129,6 +128,9 @@ class BackendController
                        LoginRefresh.initialize();
                }');
 
+        // load module menu
+        $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ModuleMenu');
+
         // load Toolbar class
         $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Toolbar');
 
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/ModuleMenu.js b/typo3/sysext/backend/Resources/Public/JavaScript/ModuleMenu.js
new file mode 100644 (file)
index 0000000..fa7215e
--- /dev/null
@@ -0,0 +1,318 @@
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+
+/**
+ * Class to render the module menu and handle the BE navigation
+ */
+require(
+       [
+               'jquery',
+               'TYPO3/CMS/Backend/Icons',
+               'TYPO3/CMS/Backend/Viewport'
+       ],
+       function ($, Icons) {
+               if (typeof TYPO3.ModuleMenu !== 'undefined') {
+                       return TYPO3.ModuleMenu.App;
+               }
+               TYPO3.ModuleMenu = {};
+               TYPO3.ModuleMenu.App = {
+                       loadedModule: null,
+                       loadedNavigationComponentId: '',
+                       availableNavigationComponents: {},
+
+                       initialize: function () {
+                               var me = this;
+
+                               // load the start module
+                               if (top.startInModule && top.startInModule[0] && $('#' + top.startInModule[0]).length > 0) {
+                                       me.showModule(top.startInModule[0], top.startInModule[1]);
+                               } else {
+                                       // fetch first module
+                                       if ($('.t3js-mainmodule:first').attr('id')) {
+                                               me.showModule($('.t3js-mainmodule:first').attr('id'));
+                                       }
+                                       // else case: the main module has no entries, this is probably a backend
+                                       // user with very little access rights, maybe only the logout button and
+                                       // a user settings module in topbar.
+                               }
+
+                               // check if module menu should be collapsed or not
+                               var state = Ext.state.Manager.getProvider().get('typo3-module-menu');
+                               if (state && state.collapsed) {
+                                       TYPO3.ModuleMenu.App.toggleMenu(state.collapsed);
+                               }
+
+                               // check if there are collapsed items in the users' configuration
+                               require(['TYPO3/CMS/Backend/Storage'], function () {
+                                       var collapsedMainMenuItems = me.getCollapsedMainMenuItems();
+                                       $.each(collapsedMainMenuItems, function (key, itm) {
+                                               if (itm !== true) {
+                                                       return;
+                                               }
+                                               var $group = $('#' + key);
+                                               if ($group.length > 0) {
+                                                       var $groupContainer = $group.find('.modulemenu-group-container');
+                                                       $group.addClass('collapsed').removeClass('expanded');
+                                                       TYPO3.Backend.NavigationContainer.cleanup();
+                                                       $groupContainer.hide().promise().done(function () {
+                                                               TYPO3.Backend.doLayout();
+                                                       });
+                                               }
+                                       });
+                                       me.initializeEvents();
+                               });
+                       },
+
+                       initializeEvents: function () {
+                               var me = this;
+                               $(document).on('click', '.modulemenu-group .modulemenu-group-header', function () {
+                                       var $group = $(this).parent('.modulemenu-group');
+                                       var $groupContainer = $group.find('.modulemenu-group-container');
+
+                                       TYPO3.Backend.NavigationContainer.cleanup();
+                                       if ($group.hasClass('expanded')) {
+                                               me.addCollapsedMainMenuItem($group.attr('id'));
+                                               $group.addClass('collapsed').removeClass('expanded');
+                                               $groupContainer.stop().slideUp().promise().done(function () {
+                                                       TYPO3.Backend.doLayout();
+                                               });
+                                       } else {
+                                               me.removeCollapseMainMenuItem($group.attr('id'));
+                                               $group.addClass('expanded').removeClass('collapsed');
+                                               $groupContainer.stop().slideDown().promise().done(function () {
+                                                       TYPO3.Backend.doLayout();
+                                               });
+                                       }
+
+                               });
+                               // register clicking on sub modules
+                               $(document).on('click', '.modulemenu-item,.t3-menuitem-submodule', function (evt) {
+                                       evt.preventDefault();
+                                       me.showModule($(this).attr('id'));
+                                       TYPO3.Backend.doLayout();
+                               });
+                               $(document).on('click', '.t3js-topbar-button-modulemenu',
+                                       function (evt) {
+                                               evt.preventDefault();
+                                               TYPO3.ModuleMenu.App.toggleMenu();
+                                       }
+                               );
+                               $(document).on('click', '.t3js-scaffold-content-overlay',
+                                       function (evt) {
+                                               evt.preventDefault();
+                                               TYPO3.ModuleMenu.App.toggleMenu(true);
+                                       }
+                               );
+                               $(document).on('click', '.t3js-topbar-button-navigationcomponent',
+                                       function (evt) {
+                                               evt.preventDefault();
+                                               TYPO3.Backend.NavigationContainer.toggle();
+                                       }
+                               );
+
+                       },
+                       toggleMenu: function (collapse) {
+                               TYPO3.Backend.NavigationContainer.cleanup();
+
+                               var $mainContainer = $('.t3js-scaffold');
+                               var expandedClass = 'scaffold-modulemenu-expanded';
+
+                               if (typeof collapse === 'undefined') {
+                                       collapse = $mainContainer.hasClass(expandedClass);
+                               }
+                               if (collapse) {
+                                       $mainContainer.removeClass(expandedClass);
+                               } else {
+                                       $mainContainer.addClass(expandedClass);
+                                       $('.scaffold').removeClass('scaffold-search-expanded');
+                                       $('.scaffold').removeClass('scaffold-toolbar-expanded');
+                               }
+
+                               // @todo remove once we have a new state manager
+                               Ext.state.Manager.set(
+                                       'typo3-module-menu',
+                                       {
+                                               collapsed: collapse
+                                       }
+                               );
+
+                               TYPO3.Backend.doLayout();
+                       },
+
+                       /* fetch the data for a submodule */
+                       getRecordFromName: function (name) {
+                               var $subModuleElement = $('#' + name);
+                               return {
+                                       name: name,
+                                       navigationComponentId: $subModuleElement.data('navigationcomponentid'),
+                                       navigationFrameScript: $subModuleElement.data('navigationframescript'),
+                                       navigationFrameScriptParam: $subModuleElement.data('navigationframescriptparameters'),
+                                       link: $subModuleElement.find('a').attr('href')
+                               };
+                       },
+
+                       showModule: function (mod, params) {
+                               params = params || '';
+                               params = this.includeId(mod, params);
+                               var record = this.getRecordFromName(mod);
+                               this.loadModuleComponents(record, params);
+                       },
+
+                       loadModuleComponents: function (record, params) {
+                               var mod = record.name;
+                               if (record.navigationComponentId) {
+                                       this.loadNavigationComponent(record.navigationComponentId);
+                               } else if (record.navigationFrameScript) {
+                                       TYPO3.Backend.NavigationContainer.show('typo3-navigationIframe');
+                                       this.openInNavFrame(record.navigationFrameScript, record.navigationFrameScriptParam);
+                               } else {
+                                       TYPO3.Backend.NavigationContainer.hide();
+                               }
+
+                               this.highlightModuleMenuItem(mod);
+                               this.loadedModule = mod;
+                               this.openInContentFrame(record.link, params);
+
+                               // compatibility
+                               top.currentSubScript = record.link;
+                               top.currentModuleLoaded = mod;
+
+                               TYPO3.Backend.doLayout();
+                       },
+
+                       includeId: function (mod, params) {
+                               if (typeof mod === 'undefined') {
+                                       return params;
+                               }
+                               //get id
+                               var section = mod.split('_')[0];
+                               if (top.fsMod.recentIds[section]) {
+                                       params = 'id=' + top.fsMod.recentIds[section] + '&' + params;
+                               }
+
+                               return params;
+                       },
+
+                       loadNavigationComponent: function (navigationComponentId) {
+                               TYPO3.Backend.NavigationContainer.show(navigationComponentId);
+                               if (navigationComponentId === this.loadedNavigationComponentId) {
+                                       return;
+                               }
+                               if (this.loadedNavigationComponentId !== '') {
+                                       Ext.getCmp(this.loadedNavigationComponentId).hide();
+                               }
+                               if ($('.t3js-scaffold-content-navigation [data-component="' + navigationComponentId + '"]').length < 1) {
+                                       $('.t3js-scaffold-content-navigation')
+                                               .append('<div class="scaffold-content-navigation-component" data-component="' + navigationComponentId + '" id="navigationComponent-' + navigationComponentId + '"></div>');
+                               }
+                               var component = Ext.getCmp(navigationComponentId);
+                               if (typeof component === 'undefined') {
+                                       /** @todo fix hard coded pagetree **/
+                                       component = new TYPO3.Components.PageTree.App();
+                                       component.render('navigationComponent-' + navigationComponentId);
+                               }
+                               TYPO3.Backend.NavigationContainer.show(navigationComponentId);
+                               this.loadedNavigationComponentId = navigationComponentId;
+                       },
+
+                       registerNavigationComponent: function (componentId, initCallback) {
+                               this.availableNavigationComponents[componentId] = initCallback;
+                       },
+
+                       openInNavFrame: function (url, params) {
+                               var navUrl = url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : '');
+                               var currentUrl = this.relativeUrl(TYPO3.Backend.NavigationContainer.getUrl());
+                               if (currentUrl !== navUrl) {
+                                       TYPO3.Backend.NavigationContainer.refresh();
+                               }
+                               TYPO3.Backend.NavigationContainer.setUrl(url);
+                       },
+
+                       openInContentFrame: function (url, params) {
+                               if (top.nextLoadModuleUrl) {
+                                       TYPO3.Backend.ContentContainer.setUrl(top.nextLoadModuleUrl);
+                                       top.nextLoadModuleUrl = '';
+                               } else {
+                                       var urlToLoad = url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : '');
+                                       TYPO3.Backend.ContentContainer.setUrl(urlToLoad);
+                               }
+                       },
+
+                       highlightModuleMenuItem: function (module, mainModule) {
+                               $('.modulemenu-item.active').removeClass('active');
+                               $('#' + module).addClass('active');
+                       },
+
+                       relativeUrl: function (url) {
+                               if (url) {
+                                       return url.replace(TYPO3.configuration.siteUrl + 'typo3/', '');
+                               } else {
+                                       return '';
+                               }
+                       },
+
+                       // refresh the HTML by fetching the menu again
+                       refreshMenu: function () {
+                               $.ajax(TYPO3.settings.ajaxUrls['modulemenu']).done(function (result) {
+                                       $('#menu').replaceWith(result.menu);
+                                       if (top.currentModuleLoaded) {
+                                               TYPO3.ModuleMenu.App.highlightModuleMenuItem(top.currentModuleLoaded);
+                                       }
+                                       TYPO3.Backend.doLayout();
+                               });
+                       },
+
+                       reloadFrames: function () {
+                               TYPO3.Backend.NavigationContainer.refresh();
+                               TYPO3.Backend.ContentContainer.refresh();
+                       },
+
+                       /**
+                        * fetches all module menu elements in the local storage that should be collapsed
+                        * @returns {*}
+                        */
+                       getCollapsedMainMenuItems: function () {
+                               if (TYPO3.Storage.Persistent.isset('modulemenu')) {
+                                       return JSON.parse(TYPO3.Storage.Persistent.get('modulemenu'));
+                               } else {
+                                       return {};
+                               }
+                       },
+
+                       /**
+                        * adds a module menu item to the local storage
+                        * @param item
+                        */
+                       addCollapsedMainMenuItem: function (item) {
+                               var existingItems = this.getCollapsedMainMenuItems();
+                               existingItems[item] = true;
+                               TYPO3.Storage.Persistent.set('modulemenu', JSON.stringify(existingItems));
+                       },
+
+                       /**
+                        * removes a module menu item from the local storage
+                        * @param item
+                        */
+                       removeCollapseMainMenuItem: function (item) {
+                               var existingItems = this.getCollapsedMainMenuItems();
+                               delete existingItems[item];
+                               TYPO3.Storage.Persistent.set('modulemenu', JSON.stringify(existingItems));
+                       }
+
+               };
+               // start the module menu app
+               TYPO3.ModuleMenu.App.initialize();
+               return TYPO3.ModuleMenu;
+       }
+);
index 05340c9..723dc91 100644 (file)
@@ -20,7 +20,7 @@ require(
        [
                'jquery',
                'TYPO3/CMS/Backend/Icons',
-               'TYPO3/CMS/Backend/modulemenu'
+               'TYPO3/CMS/Backend/ModuleMenu'
        ],
        function ($) {
 
index bb9970d..9011d81 100644 (file)
@@ -420,7 +420,7 @@ TYPO3.Components.PageTree.App = Ext.extend(Ext.Panel, {
  */
 require(
        [
-               'TYPO3/CMS/Backend/modulemenu'
+               'TYPO3/CMS/Backend/ModuleMenu'
        ],
        function () {
                // extjs loading bugfix
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/modulemenu.js b/typo3/sysext/backend/Resources/Public/JavaScript/modulemenu.js
deleted file mode 100644 (file)
index fa7215e..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-
-/**
- * Class to render the module menu and handle the BE navigation
- */
-require(
-       [
-               'jquery',
-               'TYPO3/CMS/Backend/Icons',
-               'TYPO3/CMS/Backend/Viewport'
-       ],
-       function ($, Icons) {
-               if (typeof TYPO3.ModuleMenu !== 'undefined') {
-                       return TYPO3.ModuleMenu.App;
-               }
-               TYPO3.ModuleMenu = {};
-               TYPO3.ModuleMenu.App = {
-                       loadedModule: null,
-                       loadedNavigationComponentId: '',
-                       availableNavigationComponents: {},
-
-                       initialize: function () {
-                               var me = this;
-
-                               // load the start module
-                               if (top.startInModule && top.startInModule[0] && $('#' + top.startInModule[0]).length > 0) {
-                                       me.showModule(top.startInModule[0], top.startInModule[1]);
-                               } else {
-                                       // fetch first module
-                                       if ($('.t3js-mainmodule:first').attr('id')) {
-                                               me.showModule($('.t3js-mainmodule:first').attr('id'));
-                                       }
-                                       // else case: the main module has no entries, this is probably a backend
-                                       // user with very little access rights, maybe only the logout button and
-                                       // a user settings module in topbar.
-                               }
-
-                               // check if module menu should be collapsed or not
-                               var state = Ext.state.Manager.getProvider().get('typo3-module-menu');
-                               if (state && state.collapsed) {
-                                       TYPO3.ModuleMenu.App.toggleMenu(state.collapsed);
-                               }
-
-                               // check if there are collapsed items in the users' configuration
-                               require(['TYPO3/CMS/Backend/Storage'], function () {
-                                       var collapsedMainMenuItems = me.getCollapsedMainMenuItems();
-                                       $.each(collapsedMainMenuItems, function (key, itm) {
-                                               if (itm !== true) {
-                                                       return;
-                                               }
-                                               var $group = $('#' + key);
-                                               if ($group.length > 0) {
-                                                       var $groupContainer = $group.find('.modulemenu-group-container');
-                                                       $group.addClass('collapsed').removeClass('expanded');
-                                                       TYPO3.Backend.NavigationContainer.cleanup();
-                                                       $groupContainer.hide().promise().done(function () {
-                                                               TYPO3.Backend.doLayout();
-                                                       });
-                                               }
-                                       });
-                                       me.initializeEvents();
-                               });
-                       },
-
-                       initializeEvents: function () {
-                               var me = this;
-                               $(document).on('click', '.modulemenu-group .modulemenu-group-header', function () {
-                                       var $group = $(this).parent('.modulemenu-group');
-                                       var $groupContainer = $group.find('.modulemenu-group-container');
-
-                                       TYPO3.Backend.NavigationContainer.cleanup();
-                                       if ($group.hasClass('expanded')) {
-                                               me.addCollapsedMainMenuItem($group.attr('id'));
-                                               $group.addClass('collapsed').removeClass('expanded');
-                                               $groupContainer.stop().slideUp().promise().done(function () {
-                                                       TYPO3.Backend.doLayout();
-                                               });
-                                       } else {
-                                               me.removeCollapseMainMenuItem($group.attr('id'));
-                                               $group.addClass('expanded').removeClass('collapsed');
-                                               $groupContainer.stop().slideDown().promise().done(function () {
-                                                       TYPO3.Backend.doLayout();
-                                               });
-                                       }
-
-                               });
-                               // register clicking on sub modules
-                               $(document).on('click', '.modulemenu-item,.t3-menuitem-submodule', function (evt) {
-                                       evt.preventDefault();
-                                       me.showModule($(this).attr('id'));
-                                       TYPO3.Backend.doLayout();
-                               });
-                               $(document).on('click', '.t3js-topbar-button-modulemenu',
-                                       function (evt) {
-                                               evt.preventDefault();
-                                               TYPO3.ModuleMenu.App.toggleMenu();
-                                       }
-                               );
-                               $(document).on('click', '.t3js-scaffold-content-overlay',
-                                       function (evt) {
-                                               evt.preventDefault();
-                                               TYPO3.ModuleMenu.App.toggleMenu(true);
-                                       }
-                               );
-                               $(document).on('click', '.t3js-topbar-button-navigationcomponent',
-                                       function (evt) {
-                                               evt.preventDefault();
-                                               TYPO3.Backend.NavigationContainer.toggle();
-                                       }
-                               );
-
-                       },
-                       toggleMenu: function (collapse) {
-                               TYPO3.Backend.NavigationContainer.cleanup();
-
-                               var $mainContainer = $('.t3js-scaffold');
-                               var expandedClass = 'scaffold-modulemenu-expanded';
-
-                               if (typeof collapse === 'undefined') {
-                                       collapse = $mainContainer.hasClass(expandedClass);
-                               }
-                               if (collapse) {
-                                       $mainContainer.removeClass(expandedClass);
-                               } else {
-                                       $mainContainer.addClass(expandedClass);
-                                       $('.scaffold').removeClass('scaffold-search-expanded');
-                                       $('.scaffold').removeClass('scaffold-toolbar-expanded');
-                               }
-
-                               // @todo remove once we have a new state manager
-                               Ext.state.Manager.set(
-                                       'typo3-module-menu',
-                                       {
-                                               collapsed: collapse
-                                       }
-                               );
-
-                               TYPO3.Backend.doLayout();
-                       },
-
-                       /* fetch the data for a submodule */
-                       getRecordFromName: function (name) {
-                               var $subModuleElement = $('#' + name);
-                               return {
-                                       name: name,
-                                       navigationComponentId: $subModuleElement.data('navigationcomponentid'),
-                                       navigationFrameScript: $subModuleElement.data('navigationframescript'),
-                                       navigationFrameScriptParam: $subModuleElement.data('navigationframescriptparameters'),
-                                       link: $subModuleElement.find('a').attr('href')
-                               };
-                       },
-
-                       showModule: function (mod, params) {
-                               params = params || '';
-                               params = this.includeId(mod, params);
-                               var record = this.getRecordFromName(mod);
-                               this.loadModuleComponents(record, params);
-                       },
-
-                       loadModuleComponents: function (record, params) {
-                               var mod = record.name;
-                               if (record.navigationComponentId) {
-                                       this.loadNavigationComponent(record.navigationComponentId);
-                               } else if (record.navigationFrameScript) {
-                                       TYPO3.Backend.NavigationContainer.show('typo3-navigationIframe');
-                                       this.openInNavFrame(record.navigationFrameScript, record.navigationFrameScriptParam);
-                               } else {
-                                       TYPO3.Backend.NavigationContainer.hide();
-                               }
-
-                               this.highlightModuleMenuItem(mod);
-                               this.loadedModule = mod;
-                               this.openInContentFrame(record.link, params);
-
-                               // compatibility
-                               top.currentSubScript = record.link;
-                               top.currentModuleLoaded = mod;
-
-                               TYPO3.Backend.doLayout();
-                       },
-
-                       includeId: function (mod, params) {
-                               if (typeof mod === 'undefined') {
-                                       return params;
-                               }
-                               //get id
-                               var section = mod.split('_')[0];
-                               if (top.fsMod.recentIds[section]) {
-                                       params = 'id=' + top.fsMod.recentIds[section] + '&' + params;
-                               }
-
-                               return params;
-                       },
-
-                       loadNavigationComponent: function (navigationComponentId) {
-                               TYPO3.Backend.NavigationContainer.show(navigationComponentId);
-                               if (navigationComponentId === this.loadedNavigationComponentId) {
-                                       return;
-                               }
-                               if (this.loadedNavigationComponentId !== '') {
-                                       Ext.getCmp(this.loadedNavigationComponentId).hide();
-                               }
-                               if ($('.t3js-scaffold-content-navigation [data-component="' + navigationComponentId + '"]').length < 1) {
-                                       $('.t3js-scaffold-content-navigation')
-                                               .append('<div class="scaffold-content-navigation-component" data-component="' + navigationComponentId + '" id="navigationComponent-' + navigationComponentId + '"></div>');
-                               }
-                               var component = Ext.getCmp(navigationComponentId);
-                               if (typeof component === 'undefined') {
-                                       /** @todo fix hard coded pagetree **/
-                                       component = new TYPO3.Components.PageTree.App();
-                                       component.render('navigationComponent-' + navigationComponentId);
-                               }
-                               TYPO3.Backend.NavigationContainer.show(navigationComponentId);
-                               this.loadedNavigationComponentId = navigationComponentId;
-                       },
-
-                       registerNavigationComponent: function (componentId, initCallback) {
-                               this.availableNavigationComponents[componentId] = initCallback;
-                       },
-
-                       openInNavFrame: function (url, params) {
-                               var navUrl = url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : '');
-                               var currentUrl = this.relativeUrl(TYPO3.Backend.NavigationContainer.getUrl());
-                               if (currentUrl !== navUrl) {
-                                       TYPO3.Backend.NavigationContainer.refresh();
-                               }
-                               TYPO3.Backend.NavigationContainer.setUrl(url);
-                       },
-
-                       openInContentFrame: function (url, params) {
-                               if (top.nextLoadModuleUrl) {
-                                       TYPO3.Backend.ContentContainer.setUrl(top.nextLoadModuleUrl);
-                                       top.nextLoadModuleUrl = '';
-                               } else {
-                                       var urlToLoad = url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : '');
-                                       TYPO3.Backend.ContentContainer.setUrl(urlToLoad);
-                               }
-                       },
-
-                       highlightModuleMenuItem: function (module, mainModule) {
-                               $('.modulemenu-item.active').removeClass('active');
-                               $('#' + module).addClass('active');
-                       },
-
-                       relativeUrl: function (url) {
-                               if (url) {
-                                       return url.replace(TYPO3.configuration.siteUrl + 'typo3/', '');
-                               } else {
-                                       return '';
-                               }
-                       },
-
-                       // refresh the HTML by fetching the menu again
-                       refreshMenu: function () {
-                               $.ajax(TYPO3.settings.ajaxUrls['modulemenu']).done(function (result) {
-                                       $('#menu').replaceWith(result.menu);
-                                       if (top.currentModuleLoaded) {
-                                               TYPO3.ModuleMenu.App.highlightModuleMenuItem(top.currentModuleLoaded);
-                                       }
-                                       TYPO3.Backend.doLayout();
-                               });
-                       },
-
-                       reloadFrames: function () {
-                               TYPO3.Backend.NavigationContainer.refresh();
-                               TYPO3.Backend.ContentContainer.refresh();
-                       },
-
-                       /**
-                        * fetches all module menu elements in the local storage that should be collapsed
-                        * @returns {*}
-                        */
-                       getCollapsedMainMenuItems: function () {
-                               if (TYPO3.Storage.Persistent.isset('modulemenu')) {
-                                       return JSON.parse(TYPO3.Storage.Persistent.get('modulemenu'));
-                               } else {
-                                       return {};
-                               }
-                       },
-
-                       /**
-                        * adds a module menu item to the local storage
-                        * @param item
-                        */
-                       addCollapsedMainMenuItem: function (item) {
-                               var existingItems = this.getCollapsedMainMenuItems();
-                               existingItems[item] = true;
-                               TYPO3.Storage.Persistent.set('modulemenu', JSON.stringify(existingItems));
-                       },
-
-                       /**
-                        * removes a module menu item from the local storage
-                        * @param item
-                        */
-                       removeCollapseMainMenuItem: function (item) {
-                               var existingItems = this.getCollapsedMainMenuItems();
-                               delete existingItems[item];
-                               TYPO3.Storage.Persistent.set('modulemenu', JSON.stringify(existingItems));
-                       }
-
-               };
-               // start the module menu app
-               TYPO3.ModuleMenu.App.initialize();
-               return TYPO3.ModuleMenu;
-       }
-);