Feature #32309 » cardLayout.diff

current state of the patch, please refer to commit message to see the need for discussion - Kay Strobach, 2011-12-07 08:07

View differences:

typo3/js/extjs/iframepanel.js
81 81
	setUrl: function(source) {
82 82
		this.setMask();
83 83
		this.body.dom.src = source;
84
			// go up the object tree and ensure, that the frame gets visible
85
		wrapper = this.findParentBy(
86
			function(container, component) {
87
				if(container.id === 'typo3-contentContainerWrapper') {
88
					return true;
89
				}
90
			}
91
		);
92
		if(wrapper) {
93
			wrapper.getLayout().setActiveItem(this.id);
94
		}
84 95
	},
85 96

  
86 97
	resetUrl: function() {
typo3/js/extjs/viewportConfiguration.js
27 27
Ext.ns('TYPO3');
28 28

  
29 29
/**
30
 * The Cards Configuration for the BE Module Cards
31
 *
32
 * New items need to be appended here
33
 * cards id needs to be prepended with typo3-card- the rest of the id is the
34
 * be module name as passed it is normally in TYPO3
35
 * Cards shouldn't be simple iframes for performance reasons
36
 *
37
 * @author Kay Strobach    <typo3@kay-strobach.de>
38
*/
39

  
40
TYPO3.Viewport.ContentCards = {
41
		// Add a card to either the config or if already rendered to the wrapper
42
	addContentCard: function(name,config) {
43
		config.id = 'typo3-card-' + name;
44
		if (Ext.ready) {
45
			Ext.getCmp('typo3-contentContainerWrapper').add(config);
46
		} else {
47
			this.cards.push(config);
48
		}
49
	},
50
	cards: [
51
		{
52
			id: 'typo3-contentContainer',
53
			border: false,
54
			xtype: 'iframePanel',
55
			name: 'content'
56
		}, {
57
			id:'typo3-card-tools_txextdevevalM1',
58
			html: 'extdeval',
59
			setUrl: function() {
60
				TYPO3.Flashmessage.display(
61
					1,
62
					'function called',
63
					'you fired the setUrl event of extdeval'
64
				);
65
			}
66
		}, {
67
			id: 'typo3-card-tools_txreportsM1',
68
			html: 'i´m the report card'
69
		}
70
	]
71
};
72

  
73

  
74
/**
30 75
 * The backend viewport configuration
31 76
 *
32 77
 * @author Stefan Galinski <stefan.galinski@gmail.com>
......
105 150
							border: false,
106 151
							hidden: true,
107 152
							floatable: true,
108
							xtime: 'iframePanel',
153
							xtype: 'iframePanel',
109 154
							width: 5
110 155
						},
111 156
						{
112
							id: 'typo3-contentContainer',
157
							id: 'typo3-contentContainerWrapper',
113 158
							region: 'center',
114 159
							anchor: '100% 100%',
115 160
							border: false,
116
							xtype: 'iframePanel',
117
							name: 'content'
161
							xtype: 'panel',
162
							layout: 'card',
163
							activeItem: 0,
164
							items: TYPO3.Viewport.ContentCards.cards
118 165
						}
119 166
					]
120 167
				},
typo3/js/modulemenu.js
257 257
				TYPO3.Backend.NavigationContainer.hide();
258 258
				TYPO3.Backend.NavigationDummy.show();
259 259
			}
260
			this.openInContentFrame(record.originalLink, params);
261 260
			this.loadedModule = mod;
262 261
			this.highlightModuleMenuItem(mod);
262
			this.openInContentFrame(record.originalLink, params);
263 263

  
264 264
				// compatibility
265 265
			top.currentSubScript = record.originalLink;
......
324 324
	},
325 325

  
326 326
	openInContentFrame: function(url, params) {
327
		var relatedCard, urlToLoad;
327 328
		if (top.nextLoadModuleUrl) {
328 329
			TYPO3.Backend.ContentContainer.setUrl(top.nextLoadModuleUrl);
329 330
			top.nextLoadModuleUrl = '';
330 331
		} else {
331
			TYPO3.Backend.ContentContainer.setUrl(url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : ''));
332
			relatedCard = Ext.getCmp('typo3-contentContainerWrapper').get('typo3-card-' + this.loadedModule);
333
			urlToLoad   = url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : '')
334
			if(relatedCard) {
335
				if (typeof relatedCard.setUrl === 'function') {
336
					relatedCard.setUrl(urlToLoad);
337
				}
338
				Ext.getCmp('typo3-contentContainerWrapper').getLayout().setActiveItem('typo3-card-' + this.loadedModule);
339
			} else {
340
				TYPO3.Backend.ContentContainer.setUrl(urlToLoad);
341
				Ext.getCmp('typo3-contentContainerWrapper').getLayout().setActiveItem('typo3-card-' + this.loadedModule);
342
			}
332 343
		}
333 344
	},
334 345

  
(1-1/8)