[TASK] Rewrite Module Menu
Currently rendering of the module menu of the backend left side is quite complex. This is because there are several parts introduced in recent TYPO3 versions, that have only substituted parts of the existing code. So the "old" code was still in use. To give a better understanding I will first introduce all the parts relevant to the rendering of the module menu. PHP side * The mother of all classes is ModuleLoader.php, originally made by Kasper, which takes TBE_MODULES and compiles a long list of all modules into an array. (ModuleLoader->load()). Currently this class is kept as is for the time being. * For 4.1/4.2, the ModuleMenuView was introduced, a wrapper class to access the data of ModuleLoader and also does some other stuff like saving the Open/Collapsed state of the modules via AJAX (note: this will be handled browser-internally via LocalStorage from now on, as it saves HTTP requests). It does one other thing: Rendering of the Logout Button. This is completely in the wrong place right now, as the Logout button isn't within the module menu frame anymore since 4.x, but on the top right area of the backend. * The BackendController class is responsible for adding all HTML and JS code code to the backend.php page so it can be rendered. It instantiates the ModuleMenuView class to call the LogoutButton function. * As one of the first steps of rewriting the module menu a couple of versions ago, there was a ModuleController, which was again a wrapper for ModuleLoader while putting everything together in a ModuleRepository, along with Module objects and a singleton object ModuleStorage. This new version allows for nesting of up to three levels (incl. modfuncs), along with clear objects instead of arrays. JS side * The module menu isn't output with a single line of PHP code, as it is defined as a ExtJS storage which fetches the module menu asynchronously. The HTML code is built in a ExtJS template, which leads to the funny effect that the raw backend.php only zero HTML code output for the module menu. An extra AJAX request is fired to load up the module, which then is prepared and templated by ExtJS. The changes: * The logout button rendering is now done in the BackendController and not in the ModuleMenuView class. * The menu is now outputted in the BackendController at the same time as backend.php by a standalone Fluid template. The menu is built by a simple call to the ModuleRepository which returns a ModuleStorage. * ModuleMenuView, ModuleMenuController are not needed anymore, and are deprecated. * The JS is rewritten so that it works as before. These parts are filled up with jQuery code. * The collapsed/open state of the main modules is now done via the local storage JS functionality of the browsers to avoid further unnecessary HTTP loading operations. Resolves: #60633 Releases: 6.3 Change-Id: I5402c1345a2931340d7ec9ef1881877b39d1bfc3 Reviewed-on: http://review.typo3.org/31876 Reviewed-by:Georg Ringer <georg.ringer@gmail.com> Tested-by:
Georg Ringer <georg.ringer@gmail.com> Reviewed-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Reviewed-by:
Benjamin Mack <benni@typo3.org> Tested-by:
Benjamin Mack <benni@typo3.org>
Showing
- typo3/js/extjs/viewportConfiguration.js 1 addition, 0 deletionstypo3/js/extjs/viewportConfiguration.js
- typo3/sysext/backend/Classes/Controller/BackendController.php 52 additions, 10 deletions...3/sysext/backend/Classes/Controller/BackendController.php
- typo3/sysext/backend/Classes/Domain/Model/Module/BackendModule.php 46 additions, 8 deletions...ext/backend/Classes/Domain/Model/Module/BackendModule.php
- typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php 304 additions, 4 deletions...sses/Domain/Repository/Module/BackendModuleRepository.php
- typo3/sysext/backend/Classes/Module/ModuleController.php 2 additions, 0 deletionstypo3/sysext/backend/Classes/Module/ModuleController.php
- typo3/sysext/backend/Classes/View/ModuleMenuView.php 2 additions, 0 deletionstypo3/sysext/backend/Classes/View/ModuleMenuView.php
- typo3/sysext/backend/Resources/Private/Templates/ModuleMenu/Main.html 19 additions, 0 deletions.../backend/Resources/Private/Templates/ModuleMenu/Main.html
- typo3/sysext/backend/Resources/Public/JavaScript/modulemenu.js 103 additions, 210 deletions.../sysext/backend/Resources/Public/JavaScript/modulemenu.js
- typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php 1 addition, 1 deletion...core/Classes/Authentication/BackendUserAuthentication.php
- typo3/sysext/core/Configuration/DefaultConfiguration.php 2 additions, 6 deletionstypo3/sysext/core/Configuration/DefaultConfiguration.php
- typo3/sysext/t3skin/Resources/Public/Css/structure/module_menu.css 5 additions, 2 deletions...ext/t3skin/Resources/Public/Css/structure/module_menu.css
Please register or sign in to comment