[BUGFIX][!!!] Problems with new Card Layout in backend modules
authorKay Strobach <typo3@kay-strobach.de>
Thu, 28 Jul 2011 11:26:02 +0000 (13:26 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Sat, 30 Jul 2011 13:31:40 +0000 (15:31 +0200)
There are warnings with backend modules concerning the new _JSINIT array.
To avoid these problems, this patch improves the way the module array is handled.

Module names starting with an underscore character "_" are not considered anymore.

Change-Id: Id749538dd8ee570581cb49df172800ec76242041
Releases: 4.6, 4.5
Resolves: #28523
Reviewed-on: http://review.typo3.org/3820
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
t3lib/class.t3lib_loadmodules.php
typo3/backend.php
typo3/js/extjs/iframepanel.js
typo3/js/extjs/viewportConfiguration.js
typo3/js/modulemenu.js

index 0813cea..507b1b4 100644 (file)
@@ -86,7 +86,6 @@ class t3lib_loadModules {
                }
 
                /*
-
                                         $modulesArray might look like this when entering this function.
                                         Notice the two modules added by extensions - they have a path attached
 
@@ -104,19 +103,11 @@ 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);
 
                /*
@@ -402,7 +393,12 @@ class t3lib_loadModules {
                $theMods = array();
                if (is_array($arr)) {
                        foreach ($arr as $mod => $subs) {
-                               $mod = $this->cleanName($mod); // clean module name to alphanum
+                                       // Module names must not start with an underline character
+                               if (strpos($mod, '_') === 0) {
+                                       continue;
+                               }
+                                       // Module names must be alpha-numeric
+                               $mod = $this->cleanName($mod);
                                if ($mod) {
                                        if ($subs) {
                                                $subsArr = t3lib_div::trimExplode(',', $subs);
index 334a529..52fd724 100644 (file)
@@ -155,7 +155,7 @@ class TYPO3backend {
                $this->executeHook('constructPostProcess');
 
                        // Add previously generated JS to the backend
-               if (is_array($GLOBALS['TBE_MODULES']['_JSINIT'])) {
+               if (isset($GLOBALS['TBE_MODULES']['_JSINIT']) && is_array($GLOBALS['TBE_MODULES']['_JSINIT'])) {
                        foreach ($GLOBALS['TBE_MODULES']['_JSINIT'] as $value) {
                                $this->js .= $value;
                        }
index db27083..ab517aa 100644 (file)
@@ -96,14 +96,14 @@ TYPO3.iframePanel = Ext.extend(Ext.Panel, {
                        // 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)
+                       currentSource = currentSource.substr(0, currentSource.length)
                }
-               if (currentSource.substr(0,1) == '/') {
+               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)
+                       source = source.substr(0, source.length-1)
                }
 
                        // Check if new uri should be loaded
index c3b9d9c..5bfb988 100644 (file)
@@ -39,14 +39,14 @@ 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;
+               config.id = 'typo3-card-' + name;
                if (Ext.ready) {
                        Ext.getCmp('typo3-contentContainerWrapper').add(config);
                } else {
                        this.cards.push(config);
                }
        },
-       cards:[
+       cards: [
                {
                        id: 'typo3-contentContainer',
                        border: false,
index ce02b24..9cbeec5 100644 (file)
@@ -223,6 +223,7 @@ TYPO3.ModuleMenu.App = {
        },
 
        loadModuleComponents: function(record, params) {
+               var url;
                var mod = record.name;
                if (record.navigationComponentId) {
                                this.loadNavigationComponent(record.navigationComponentId);
@@ -320,6 +321,8 @@ TYPO3.ModuleMenu.App = {
        },
 
        openInContentFrame: function(url, params) {
+               var urlToLoad, relatedCard;
+
                if (top.nextLoadModuleUrl) {
                        urlToLoad = top.nextLoadModuleUrl;
                        top.nextLoadModuleUrl = '';