Revert "[FEATURE] Speed-up Backend with CardLayout"
authorXavier Perseguers <xavier@typo3.org>
Sat, 8 Oct 2011 07:19:02 +0000 (09:19 +0200)
committerXavier Perseguers <xavier@typo3.org>
Sun, 9 Oct 2011 15:25:29 +0000 (17:25 +0200)
This reverts the use of CardLayout for the Backend.
Following commits have been squashed:

9ec94db20e803641b5be39e8ac83bf18f08789ab
5ec3779c978899659694941d79492e536aba6159
873f1dfe909f500e862744c817d029c9f05328ff
a408234cdf05ef4b69682161d8e2198db71318fd
120d38d1015117cc415482e7efec35430a5e3dfd

Change-Id: I2287b18598dbc5fe546c5ddc9aa9980d9b6a3b97
Resolves: #30645
Reviewed-on: http://review.typo3.org/5630
Reviewed-by: Steffen Gebert
Tested-by: Steffen Gebert
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
t3lib/class.t3lib_extmgm.php
t3lib/class.t3lib_loadmodules.php
t3lib/js/extjs/components/pagetree/javascript/actions.js
typo3/alt_db_navframe.php
typo3/alt_file_navframe.php
typo3/backend.php
typo3/js/extjs/iframepanel.js
typo3/js/extjs/viewportConfiguration.js
typo3/js/modulemenu.js

index 502e7fc..2e4d067 100644 (file)
@@ -810,48 +810,9 @@ final class t3lib_extMgm {
                if ($path) {
                        $GLOBALS['TBE_MODULES']['_PATHS'][$main . ($sub ? '_' . $sub : '')] = $path;
                }
-                       //add module JS
-               self::addModuleContentCard('{xtype: "iframePanel"}', $main, $sub);
        }
 
        /**
-        * Sets the JS card of an ExtJS module for the card layout
-        * Replaces default JS
-        * Used by Card Layout
-        *
-        * @param       string          $jsCode is plain valid JavaScript, which is added directly, usefull for small modules only!
-        * @param       string          $mainModule is the main module key, $sub is the submodule key. So $main would be an index in the $TBE_MODULES array and $sub could be an element in the lists there.
-        * @param       string          $subModule is the submodule key. If $sub is not set a blank $main module is created.
-        * @return      void
-        */
-       public static function addModuleContentCard($jsCode, $mainModule, $subModule = '') {
-               $moduleName = $mainModule . ($subModule ? '_' . $subModule : '');
-               $GLOBALS['TBE_MODULES']['_JSINIT'][$moduleName] = '
-                       TYPO3.Viewport.ContentCards.addContentCard(
-                               "' . $moduleName . '",
-                               ' . $jsCode . '
-                       );
-               ';
-       }
-
-       /**
-        * Removes the JS card of an ExtJS module directly
-        * Used by Card Layout
-        *
-        * @param       string          $mainModule is the main module key, $sub is the submodule key. So $main would be an index in the $TBE_MODULES array and $sub could be an element in the lists there.
-        * @param       string          $subModule is the submodule key. If $sub is not set a blank $main module is created.
-        * @return void
-        */
-       public static function removeModuleContentCard($mainModule, $subModule = '') {
-               $moduleName = $mainModule . ($subModule ? '_' . $subModule : '');
-               if (array_key_exists($moduleName, $GLOBALS['TBE_MODULES']['_JSINIT'])) {
-                       unset($GLOBALS['TBE_MODULES']['_JSINIT'][$moduleName]);
-               }
-       }
-
-
-
-       /**
         * Registers an Ext.Direct component with access restrictions.
         *
         * @param string $endpointName
@@ -1699,4 +1660,4 @@ $GLOBALS[\'TYPO3_LOADED_EXT\'] = unserialize(stripslashes(\'' . addslashes(seria
        }
 }
 
-?>
\ No newline at end of file
+?>
index 507b1b4..0813cea 100644 (file)
@@ -86,6 +86,7 @@ class t3lib_loadModules {
                }
 
                /*
+
                                         $modulesArray might look like this when entering this function.
                                         Notice the two modules added by extensions - they have a path attached
 
@@ -103,11 +104,19 @@ class t3lib_loadModules {
                                                        )
 
                                        )
-               */
 
-                       // Collect required module meta information
+                                        */
+                       //
                $this->absPathArray = $modulesArray['_PATHS'];
+               unset($modulesArray['_PATHS']);
+                       // unset the array for calling external backend module dispatchers in typo3/mod.php
+               unset($modulesArray['_dispatcher']);
+                       // unset the array for calling backend modules based on external backend module dispatchers in typo3/mod.php
+               unset($modulesArray['_configuration']);
+
                $this->navigationComponents = $modulesArray['_navigationComponents'];
+               unset($modulesArray['_navigationComponents']);
+
                $theMods = $this->parseModulesArray($modulesArray);
 
                /*
@@ -393,12 +402,7 @@ class t3lib_loadModules {
                $theMods = array();
                if (is_array($arr)) {
                        foreach ($arr as $mod => $subs) {
-                                       // Module names must not start with an underline character
-                               if (strpos($mod, '_') === 0) {
-                                       continue;
-                               }
-                                       // Module names must be alpha-numeric
-                               $mod = $this->cleanName($mod);
+                               $mod = $this->cleanName($mod); // clean module name to alphanum
                                if ($mod) {
                                        if ($subs) {
                                                $subsArr = t3lib_div::trimExplode(',', $subs);
index b831603..1dbb5b0 100644 (file)
@@ -703,8 +703,8 @@ TYPO3.Components.PageTree.Actions = {
 
                fsMod.recentIds['web'] = node.attributes.nodeData.id;
 
-               TYPO3.ModuleMenu.App.openInContentFrame(
-                       currentSubScript + separator + 'id=' + node.attributes.nodeData.id
+               TYPO3.Backend.ContentContainer.setUrl(
+                       TS.PATH_typo3 + currentSubScript + separator + 'id=' + node.attributes.nodeData.id
                );
        },
 
index 537a36d..ca682c0 100644 (file)
@@ -159,7 +159,7 @@ class SC_alt_db_navframe {
                                theUrl += "?id=" + id
                        }
                        top.fsMod.currentBank = bank;
-                       top.TYPO3.ModuleMenu.App.openInContentFrame(theUrl);
+                       top.TYPO3.Backend.ContentContainer.setUrl(theUrl);
 
                        '.($this->doHighlight ? 'Tree.highlightActiveItem("web", highlightID + "_" + bank);' : '').'
                        '.(!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : 'if (linkObj) linkObj.blur(); ').'
index 6d04c1f..d3ce033 100644 (file)
@@ -173,7 +173,7 @@ class SC_alt_file_navframe {
                                theUrl += "?id=" + id
                        }
                        top.fsMod.currentBank = bank;
-                       top.TYPO3.ModuleMenu.App.openInContentFrame(theUrl);
+                       top.TYPO3.Backend.ContentContainer.setUrl(theUrl);
 
                        '.($this->doHighlight ? 'Tree.highlightActiveItem("file", highlightID + "_" + bank);' : '').'
                        '.(!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : 'if (linkObj) linkObj.blur(); ').'
index 889aa60..68a9300 100644 (file)
@@ -155,13 +155,6 @@ class TYPO3backend {
                }
 
                $this->executeHook('constructPostProcess');
-
-                       // Add previously generated JS to the backend
-               if (isset($GLOBALS['TBE_MODULES']['_JSINIT']) && is_array($GLOBALS['TBE_MODULES']['_JSINIT'])) {
-                       foreach ($GLOBALS['TBE_MODULES']['_JSINIT'] as $value) {
-                               $this->js .= $value;
-                       }
-               }
        }
 
        /**
index bc05c6d..ccd968a 100644 (file)
@@ -39,7 +39,7 @@ TYPO3.iframePanel = Ext.extend(Ext.Panel, {
        src: Ext.isIE && Ext.isSecure ? Ext.SSL_SECURE_URL : 'about:blank',
        maskMessage: ' ',
        doMask: true,
-       border: false,
+
                // component build
        initComponent: function() {
                this.bodyCfg = {
@@ -81,36 +81,8 @@ TYPO3.iframePanel = Ext.extend(Ext.Panel, {
        setUrl: function(source) {
                this.setMask();
                this.body.dom.src = source;
-               if (this.ownerCt) {
-                       if (this.ownerCt.hasLayout) {
-                               if (this.ownerCt.layout.setActiveItem) {
-                                       this.ownerCt.layout.setActiveItem(this.id);
-                               }
-                       }
-               }
        },
-       setUrlIfChanged: function(source) {
-               currentSource = this.getUrl();
-               currentSource = currentSource.substr(currentSource.length-source.length);
-
-                       // Some modules generate wrong url with unneeded string at the end
-               if (currentSource.substr(currentSource.length-1) == '?' ||
-                       currentSource.substr(currentSource.length-1) == '&') {
-                       currentSource = currentSource.substr(0, currentSource.length)
-               }
-               if (currentSource.substr(0, 1) == '/') {
-                       currentSource = currentSource.substr(1);
-               }
-               if (source.substr(source.length-1) == '?' ||
-                       source.substr(source.length-1) == '&') {
-                       source = source.substr(0, source.length-1)
-               }
 
-                       // Check if new uri should be loaded
-               if (source != currentSource) {
-                       this.setUrl(source);
-               }
-       },
        resetUrl: function() {
                this.setMask();
                this.body.dom.src = this.src;
@@ -132,24 +104,17 @@ TYPO3.iframePanel = Ext.extend(Ext.Panel, {
        /** @private */
        setMask: function() {
                if (this.doMask) {
-                               //make sure, that the mask is rendered after the container and
-                               //fits the full dimensions
-                       new Ext.util.DelayedTask(
+                       this.el.mask(this.maskMessage, 'x-mask-loading-message');
+                       this.el.addClass('t3-mask-loading');
+                               // add an onClick handler to remove the mask while clicking on the loading message
+                               // useful if user cancels loading and wants to access the content again
+                       this.el.child('.x-mask-loading-message').on(
+                               'click',
                                function() {
-                                       this.el.mask(this.maskMessage, 'x-mask-loading-message');
-                                       this.el.addClass('t3-mask-loading');
-                                               // add an onClick handler to remove the mask while clicking on the loading message
-                                               // useful if user cancels loading and wants to access the content again
-                                       this.el.child('.x-mask-loading-message').on(
-                                               'click',
-                                               function() {
-                                                       this.el.unmask();
-                                               },
-                                               this
-                                       );
+                                       this.el.unmask();
                                },
                                this
-                       ).delay(200);
+                       );
                }
        },
 
index 5bfb988..7bda328 100644 (file)
  ***************************************************************/
 
 Ext.ns('TYPO3');
-Ext.ns('TYPO3.Viewport.Panels');
-
-/**
- * The Cards Configuration for the BE Module Cards
- *
- *
- * @author Kay Strobach    <typo3@kay-strobach.de>
- */
-
-TYPO3.Viewport.ContentCards = {
-       /**
-        * Add a card to either the config or if already rendered to the wrapper
-        */
-       addContentCard: function(name,config) {
-               config.id = 'typo3-card-' + name;
-               if (Ext.ready) {
-                       Ext.getCmp('typo3-contentContainerWrapper').add(config);
-               } else {
-                       this.cards.push(config);
-               }
-       },
-       cards: [
-               {
-                       id: 'typo3-contentContainer',
-                       border: false,
-                       xtype: 'iframePanel',
-                       name: 'content'
-               }
-               /**
-                * New items need to be appended here
-                * cards id needs to be prepended with typo3-card- the rest of the id is the
-                * be module name as passed it is normally in TYPO3
-                *
-                * Example for the EM:
-                *
-                *{
-                *      xtype: 'iframePanel',
-                *      src: 'mod.php?M=tools_em',
-                *      id: 'typo3-card-tools_em'
-                *}
-                *
-                */
-       ]
-};
 
 /**
  * The backend viewport configuration
  *
  * @author Stefan Galinski <stefan.galinski@gmail.com>
- * @author Kay Strobach    <typo3@kay-strobach.de>
  */
-
-
 TYPO3.Viewport.configuration = {
        layout: 'border',
        id: 'typo3-viewport',
@@ -96,12 +49,15 @@ TYPO3.Viewport.configuration = {
                        layout: 'fit',
                        region: 'west',
                        id: 'typo3-module-menu',
+                       collapsible: false,
+                       collapseMode: null,
                        floatable: true,
                        hideCollapseTool: true,
                        split: true,
                        useSplitTips: true,
                        splitTip: top.TYPO3.LLL.viewPort.tooltipModuleMenuSplit,
                        enableChildSplit: true,
+                       border: false,
                        autoScroll: true
                },
                {
@@ -149,15 +105,16 @@ TYPO3.Viewport.configuration = {
                                                        border: false,
                                                        hidden: true,
                                                        floatable: true,
-                                                       xtype: 'iframePanel',
+                                                       xtime: 'iframePanel',
                                                        width: 5
                                                },
                                                {
-                                                       id: 'typo3-contentContainerWrapper',
-                                                       layout: 'card',
+                                                       id: 'typo3-contentContainer',
                                                        region: 'center',
-                                                       activeItem: 0,
-                                                       items: TYPO3.Viewport.ContentCards.cards
+                                                       anchor: '100% 100%',
+                                                       border: false,
+                                                       xtype: 'iframePanel',
+                                                       name: 'content'
                                                }
                                        ]
                                },
index 48a921c..3ea88d9 100644 (file)
@@ -223,37 +223,30 @@ TYPO3.ModuleMenu.App = {
        },
 
        loadModuleComponents: function(record, params) {
-               var url;
                var mod = record.name;
-               var relatedCard;
                if (record.navigationComponentId) {
-                       this.loadNavigationComponent(record.navigationComponentId);
-                       TYPO3.Backend.NavigationDummy.hide();
-                       TYPO3.Backend.NavigationIframe.getEl().parent().setStyle('overflow', 'auto');
-               } else if (record.navframe || record.navigationFrameScript) {
-                       TYPO3.Backend.NavigationDummy.hide();
-                       TYPO3.Backend.NavigationContainer.show();
-                       this.loadNavigationComponent('typo3-navigationIframe');
-                       this.openInNavFrame(record.navigationFrameScript || record.navframe, record.navigationFrameScriptParam);
-                       TYPO3.Backend.NavigationIframe.getEl().parent().setStyle('overflow', 'hidden');
-               } else {
-                       TYPO3.Backend.NavigationContainer.hide();
-                       TYPO3.Backend.NavigationDummy.show();
-               }
-                       //set internal state
-               this.loadedModule = mod;
-               this.highlightModuleMenuItem(mod);
-                       //load uri, either force if module is alread opened or lazy
-               if (Ext.getCmp('typo3-contentContainerWrapper').layout.activeItem.id == 'typo3-card-' + record.name) {
-                       this.openInContentFrame(record.originalLink, params, true);
-               } else {
+                               this.loadNavigationComponent(record.navigationComponentId);
+                               TYPO3.Backend.NavigationDummy.hide();
+                               TYPO3.Backend.NavigationIframe.getEl().parent().setStyle('overflow', 'auto');
+                       } else if (record.navframe || record.navigationFrameScript) {
+                               TYPO3.Backend.NavigationDummy.hide();
+                               TYPO3.Backend.NavigationContainer.show();
+                               this.loadNavigationComponent('typo3-navigationIframe');
+                               this.openInNavFrame(record.navigationFrameScript || record.navframe, record.navigationFrameScriptParam);
+                               TYPO3.Backend.NavigationIframe.getEl().parent().setStyle('overflow', 'hidden');
+                       } else {
+                               TYPO3.Backend.NavigationContainer.hide();
+                               TYPO3.Backend.NavigationDummy.show();
+                       }
                        this.openInContentFrame(record.originalLink, params);
-               }
-                       // compatibility
-               top.currentSubScript = record.originalLink;
-               top.currentModuleLoaded = mod;
+                       this.loadedModule = mod;
+                       this.highlightModuleMenuItem(mod);
+
+                               // compatibility
+                       top.currentSubScript = record.originalLink;
+                       top.currentModuleLoaded = mod;
 
-               TYPO3.Backend.doLayout();
+                       TYPO3.Backend.doLayout();
        },
 
        includeId: function(mod, params) {
@@ -294,7 +287,7 @@ TYPO3.ModuleMenu.App = {
 
                        // backwards compatibility
                top.nav = component;
-
+               
                TYPO3.Backend.NavigationContainer.show();
                this.loadedNavigationComponentId = navigationComponentId;
        },
@@ -311,30 +304,12 @@ TYPO3.ModuleMenu.App = {
                }
        },
 
-       openInContentFrame: function(url, params, forceLoad) {
-               var urlToLoad, relatedCard;
-
+       openInContentFrame: function(url, params) {
                if (top.nextLoadModuleUrl) {
-                       urlToLoad = top.nextLoadModuleUrl;
+                       TYPO3.Backend.ContentContainer.setUrl(top.nextLoadModuleUrl);
                        top.nextLoadModuleUrl = '';
                } else {
-                       urlToLoad = url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : '');
-               }
-                       // Make shourtcut to card
-               relatedCard = Ext.getCmp('typo3-contentContainerWrapper').get('typo3-card-' + this.loadedModule);
-                       // Decide where to load module, either in card or compatibility card
-               if (relatedCard) {
-                       if (relatedCard.getXType() == 'iframePanel') {
-                               if(forceLoad == true) {
-                                       relatedCard.setUrl(urlToLoad);
-                               } else {
-                                       relatedCard.setUrlIfChanged(urlToLoad);
-                               }
-                       }
-                       Ext.getCmp('typo3-contentContainerWrapper').layout.setActiveItem('typo3-card-' + this.loadedModule);
-               } else {
-                       TYPO3.Backend.ContentContainer.setUrl(urlToLoad);
-                       Ext.getCmp('typo3-contentContainerWrapper').layout.setActiveItem(0);
+                       TYPO3.Backend.ContentContainer.setUrl(url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : ''));
                }
        },