diff --git a/typo3/js/extjs/iframepanel.js b/typo3/js/extjs/iframepanel.js index ccd968a..5df76a9 100644 --- a/typo3/js/extjs/iframepanel.js +++ b/typo3/js/extjs/iframepanel.js @@ -81,6 +81,17 @@ TYPO3.iframePanel = Ext.extend(Ext.Panel, { setUrl: function(source) { this.setMask(); this.body.dom.src = source; + // go up the object tree and ensure, that the frame gets visible + wrapper = this.findParentBy( + function(container, component) { + if(container.id === 'typo3-contentContainerWrapper') { + return true; + } + } + ); + if(wrapper) { + wrapper.getLayout().setActiveItem(this.id); + } }, resetUrl: function() { diff --git a/typo3/js/extjs/viewportConfiguration.js b/typo3/js/extjs/viewportConfiguration.js index 7bda328..1d03f78 100644 --- a/typo3/js/extjs/viewportConfiguration.js +++ b/typo3/js/extjs/viewportConfiguration.js @@ -27,6 +27,51 @@ Ext.ns('TYPO3'); /** + * The Cards Configuration for the BE Module Cards + * + * 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 + * Cards shouldn't be simple iframes for performance reasons + * + * @author Kay Strobach +*/ + +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' + }, { + id:'typo3-card-tools_txextdevevalM1', + html: 'extdeval', + setUrl: function() { + TYPO3.Flashmessage.display( + 1, + 'function called', + 'you fired the setUrl event of extdeval' + ); + } + }, { + id: 'typo3-card-tools_txreportsM1', + html: 'i´m the report card' + } + ] +}; + + +/** * The backend viewport configuration * * @author Stefan Galinski @@ -105,16 +150,18 @@ TYPO3.Viewport.configuration = { border: false, hidden: true, floatable: true, - xtime: 'iframePanel', + xtype: 'iframePanel', width: 5 }, { - id: 'typo3-contentContainer', + id: 'typo3-contentContainerWrapper', region: 'center', anchor: '100% 100%', border: false, - xtype: 'iframePanel', - name: 'content' + xtype: 'panel', + layout: 'card', + activeItem: 0, + items: TYPO3.Viewport.ContentCards.cards } ] }, diff --git a/typo3/js/modulemenu.js b/typo3/js/modulemenu.js index ccaa881..7015bfd 100644 --- a/typo3/js/modulemenu.js +++ b/typo3/js/modulemenu.js @@ -257,9 +257,9 @@ TYPO3.ModuleMenu.App = { TYPO3.Backend.NavigationContainer.hide(); TYPO3.Backend.NavigationDummy.show(); } - this.openInContentFrame(record.originalLink, params); this.loadedModule = mod; this.highlightModuleMenuItem(mod); + this.openInContentFrame(record.originalLink, params); // compatibility top.currentSubScript = record.originalLink; @@ -324,11 +324,22 @@ TYPO3.ModuleMenu.App = { }, openInContentFrame: function(url, params) { + var relatedCard, urlToLoad; if (top.nextLoadModuleUrl) { TYPO3.Backend.ContentContainer.setUrl(top.nextLoadModuleUrl); top.nextLoadModuleUrl = ''; } else { - TYPO3.Backend.ContentContainer.setUrl(url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : '')); + relatedCard = Ext.getCmp('typo3-contentContainerWrapper').get('typo3-card-' + this.loadedModule); + urlToLoad = url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : '') + if(relatedCard) { + if (typeof relatedCard.setUrl === 'function') { + relatedCard.setUrl(urlToLoad); + } + Ext.getCmp('typo3-contentContainerWrapper').getLayout().setActiveItem('typo3-card-' + this.loadedModule); + } else { + TYPO3.Backend.ContentContainer.setUrl(urlToLoad); + Ext.getCmp('typo3-contentContainerWrapper').getLayout().setActiveItem('typo3-card-' + this.loadedModule); + } } },