-/***************************************************************\r
-* Copyright notice\r
-*\r
-* (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>\r
-* All rights reserved\r
-*\r
-* This script is part of the TYPO3 project. The TYPO3 project is\r
-* free software; you can redistribute it and/or modify\r
-* it under the terms of the GNU General Public License as published by\r
-* the Free Software Foundation; either version 2 of the License, or\r
-* (at your option) any later version.\r
-*\r
-* The GNU General Public License can be found at\r
-* http://www.gnu.org/copyleft/gpl.html.\r
-* A copy is found in the textfile GPL.txt and important notices to the license\r
-* from the author is found in LICENSE.txt distributed with these scripts.\r
-*\r
-*\r
-* This script is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-* GNU General Public License for more details.\r
-*\r
-* This copyright notice MUST APPEAR in all copies of the script!\r
-***************************************************************/\r
-\r
-/**\r
- * Set's the height of the backend in relation to the visible area. This resizes\r
- * the module menu and the content of the TYPO3 viewport e.g. if you open firebug that\r
- * itself takes some height from the bottom.\r
- *\r
- * @author Stefan Galinski <stefan.galinski@gmail.com>\r
- */\r
-TYPO3.BackendSizeManager = function() {\r
- var resizeBackend = function() {\r
- var viewportHeight = document.viewport.getHeight();\r
- var topHeight = Ext.get('typo3-toolbar').getHeight();\r
- var styles = {\r
- height: (viewportHeight - topHeight) + 'px'\r
- }\r
-\r
- Ext.get('typo3-side-menu').setStyle(styles);\r
- Ext.get('content').setStyle(styles);\r
- }\r
-\r
- Ext.EventManager.on(window, 'resize', resizeBackend);\r
- Ext.onReady(function() {\r
- resizeBackend();\r
- });\r
-}();\r
+/***************************************************************
+* Copyright notice
+*
+* (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+* A copy is found in the textfile GPL.txt and important notices to the license
+* from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * Set's the height of the backend in relation to the visible area. This resizes
+ * the module menu and the content of the TYPO3 viewport e.g. if you open firebug that
+ * itself takes some height from the bottom.
+ *
+ * @author Stefan Galinski <stefan.galinski@gmail.com>
+ */
+TYPO3.BackendSizeManager = function() {
+ var resizeBackend = function() {
+ var viewportHeight = document.viewport.getHeight();
+ var topHeight = Ext.get('typo3-toolbar').getHeight();
+ var styles = {
+ height: (viewportHeight - topHeight) + 'px'
+ }
+
+ Ext.get('typo3-side-menu').setStyle(styles);
+ Ext.get('content').setStyle(styles);
+ }
+
+ Ext.EventManager.on(window, 'resize', resizeBackend);
+ Ext.onReady(function() {
+ resizeBackend();
+ });
+}();
-/***************************************************************\r
- * Copyright notice\r
- *\r
- * (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>\r
- * All rights reserved\r
- *\r
- * This script is part of the TYPO3 project. The TYPO3 project is\r
- * free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * The GNU General Public License can be found at\r
- * http://www.gnu.org/copyleft/gpl.html.\r
- * A copy is found in the textfile GPL.txt and important notices to the license\r
- * from the author is found in LICENSE.txt distributed with these scripts.\r
- *\r
- *\r
- * This script is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * This copyright notice MUST APPEAR in all copies of the script!\r
- ***************************************************************/\r
-\r
-/**\r
- * Extends the viewport with some functionality for TYPO3.\r
- *\r
- * @author Stefan Galinski <stefan.galinski@gmail.com>\r
- */\r
-TYPO3.Viewport = Ext.extend(Ext.Viewport, {\r
- /**\r
- * Contains the navigation widgets in a simple array and identified by an unique idea\r
- *\r
- * @see registerNavigationWidget()\r
- * @var object\r
- */\r
- navigationWidgetContainer: {},\r
-\r
- /**\r
- * Contains the meta informations of the navigation widgets\r
- *\r
- * @see registerNavigationWidget()\r
- * @var object\r
- */\r
- navigationWidgetMetaData: {},\r
-\r
- /**\r
- * The toolbar area\r
- *\r
- * @var Ext.Panel\r
- */\r
- Toolbar: null,\r
-\r
- /**\r
- * The content area\r
- *\r
- * @var Ext.Panel\r
- */\r
- ContentContainer: null,\r
-\r
- /**\r
- * The navigation frame area\r
- *\r
- * @var Ext.Panel\r
- */\r
- NavigationContainer: null,\r
-\r
- /**\r
- * The module menu area\r
- *\r
- * @var Ext.Panel\r
- */\r
- ModuleMenuContainer: null,\r
-\r
- /**\r
- * Initializes the ExtJS viewport with the given configuration.\r
- *\r
- * @return void\r
- */\r
- initComponent: function() {\r
- // adjust the width of module menu\r
- this.initialConfig.items[1].width = TYPO3.configuration.moduleMenuWidth;\r
- // call parent constructor\r
- TYPO3.Viewport.superclass.initComponent.apply(this, arguments);\r
-\r
- this.ContentContainer = Ext.ComponentMgr.get('typo3-contentContainer');\r
- this.NavigationContainer = Ext.ComponentMgr.get('typo3-navigationContainer');\r
- this.Toolbar = Ext.ComponentMgr.get('typo3-toolbar');\r
- this.ModuleMenuContainer = Ext.ComponentMgr.get('typo3-module-menu');\r
-\r
- },\r
-\r
- /**\r
- * Loads a module into the content container\r
- *\r
- * @param mainModuleName string name of the main module (e.g. web)\r
- * @param subModuleName string name of the sub module (e.g. page)\r
- * @param contentScript string the content provider (path to a php script)\r
- * @return void\r
- */\r
- loadModule: function(mainModuleName, subModuleName, contentScript) {\r
- var navigationWidgetActive = false;\r
- var widgetMainModule = '';\r
- var widgetSubModule = '';\r
- var widget = null;\r
- for (var widgetId in this.navigationWidgetMetaData) {\r
- widgetMainModule = this.navigationWidgetMetaData[widgetId].mainModule;\r
- widgetSubModule = this.navigationWidgetMetaData[widgetId].subModule;\r
- widget = this.navigationWidgetMetaData[widgetId].widget;\r
-\r
- if ((widgetMainModule === mainModuleName || widgetMainModule === '*') &&\r
- (widgetSubModule === subModuleName || widgetSubModule === '*')\r
- ) {\r
- widget.show();\r
- navigationWidgetActive = true;\r
- } else {\r
- widget.hide();\r
- }\r
- }\r
-\r
- if (navigationWidgetActive) {\r
- this.NavigationContainer.show();\r
- } else {\r
- this.NavigationContainer.hide();\r
- }\r
-\r
- // append the typo3 path if it wasn't already applied\r
- // this is important for backwards compatibility (e.g. shortcuts)\r
- if (contentScript.indexOf(top.TS.PATH_typo3) !== 0) {\r
- contentScript = top.TS.PATH_typo3 + contentScript;\r
- }\r
- Ext.get('content').set({\r
- src: contentScript\r
- });\r
-\r
- this.NavigationContainer.ownerCt.doLayout();\r
- },\r
-\r
- /**\r
- * Adds the given widget to the navigation container. The key will be the id attribute\r
- * of the given widget.\r
- *\r
- * @param mainModule string main module or wildcard (*) for all\r
- * @param subModule string sub module or wildcard (*) for all\r
- * @param widget object ExtJS widget (e.g. an Ext.Panel); must contain an id attribute!\r
- * @return void\r
- */\r
- registerNavigationWidget: function(mainModule, subModule, widget) {\r
- // only one instance of specific widget may be exists!\r
- if (this.navigationWidgetMetaData[widget.id] === undefined) {\r
- this.navigationWidgetMetaData[widget.id] = {\r
- mainModule: mainModule,\r
- subModule: subModule,\r
- widget: widget\r
- };\r
-\r
- // always take the full width and height\r
- widget.anchor = '100% 100%';\r
- this.NavigationContainer.add(widget);\r
- }\r
- }\r
-});\r
-\r
-Ext.reg('typo3Viewport', TYPO3.Viewport);\r
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ * A copy is found in the textfile GPL.txt and important notices to the license
+ * from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Extends the viewport with some functionality for TYPO3.
+ *
+ * @author Stefan Galinski <stefan.galinski@gmail.com>
+ */
+TYPO3.Viewport = Ext.extend(Ext.Viewport, {
+ /**
+ * Contains the navigation widgets in a simple array and identified by an unique idea
+ *
+ * @see registerNavigationWidget()
+ * @var object
+ */
+ navigationWidgetContainer: {},
+
+ /**
+ * Contains the meta informations of the navigation widgets
+ *
+ * @see registerNavigationWidget()
+ * @var object
+ */
+ navigationWidgetMetaData: {},
+
+ /**
+ * The toolbar area
+ *
+ * @var Ext.Panel
+ */
+ Toolbar: null,
+
+ /**
+ * The content area
+ *
+ * @var Ext.Panel
+ */
+ ContentContainer: null,
+
+ /**
+ * The navigation frame area
+ *
+ * @var Ext.Panel
+ */
+ NavigationContainer: null,
+
+ /**
+ * The module menu area
+ *
+ * @var Ext.Panel
+ */
+ ModuleMenuContainer: null,
+
+ /**
+ * Initializes the ExtJS viewport with the given configuration.
+ *
+ * @return void
+ */
+ initComponent: function() {
+ // adjust the width of module menu
+ this.initialConfig.items[1].width = TYPO3.configuration.moduleMenuWidth;
+ // call parent constructor
+ TYPO3.Viewport.superclass.initComponent.apply(this, arguments);
+
+ this.ContentContainer = Ext.ComponentMgr.get('typo3-contentContainer');
+ this.NavigationContainer = Ext.ComponentMgr.get('typo3-navigationContainer');
+ this.Toolbar = Ext.ComponentMgr.get('typo3-toolbar');
+ this.ModuleMenuContainer = Ext.ComponentMgr.get('typo3-module-menu');
+
+ },
+
+ /**
+ * Loads a module into the content container
+ *
+ * @param mainModuleName string name of the main module (e.g. web)
+ * @param subModuleName string name of the sub module (e.g. page)
+ * @param contentScript string the content provider (path to a php script)
+ * @return void
+ */
+ loadModule: function(mainModuleName, subModuleName, contentScript) {
+ var navigationWidgetActive = false;
+ var widgetMainModule = '';
+ var widgetSubModule = '';
+ var widget = null;
+ for (var widgetId in this.navigationWidgetMetaData) {
+ widgetMainModule = this.navigationWidgetMetaData[widgetId].mainModule;
+ widgetSubModule = this.navigationWidgetMetaData[widgetId].subModule;
+ widget = this.navigationWidgetMetaData[widgetId].widget;
+
+ if ((widgetMainModule === mainModuleName || widgetMainModule === '*') &&
+ (widgetSubModule === subModuleName || widgetSubModule === '*')
+ ) {
+ widget.show();
+ navigationWidgetActive = true;
+ } else {
+ widget.hide();
+ }
+ }
+
+ if (navigationWidgetActive) {
+ this.NavigationContainer.show();
+ } else {
+ this.NavigationContainer.hide();
+ }
+
+ // append the typo3 path if it wasn't already applied
+ // this is important for backwards compatibility (e.g. shortcuts)
+ if (contentScript.indexOf(top.TS.PATH_typo3) !== 0) {
+ contentScript = top.TS.PATH_typo3 + contentScript;
+ }
+ Ext.get('content').set({
+ src: contentScript
+ });
+
+ this.NavigationContainer.ownerCt.doLayout();
+ },
+
+ /**
+ * Adds the given widget to the navigation container. The key will be the id attribute
+ * of the given widget.
+ *
+ * @param mainModule string main module or wildcard (*) for all
+ * @param subModule string sub module or wildcard (*) for all
+ * @param widget object ExtJS widget (e.g. an Ext.Panel); must contain an id attribute!
+ * @return void
+ */
+ registerNavigationWidget: function(mainModule, subModule, widget) {
+ // only one instance of specific widget may be exists!
+ if (this.navigationWidgetMetaData[widget.id] === undefined) {
+ this.navigationWidgetMetaData[widget.id] = {
+ mainModule: mainModule,
+ subModule: subModule,
+ widget: widget
+ };
+
+ // always take the full width and height
+ widget.anchor = '100% 100%';
+ this.NavigationContainer.add(widget);
+ }
+ }
+});
+
+Ext.reg('typo3Viewport', TYPO3.Viewport);
-/***************************************************************\r
- * Copyright notice\r
- *\r
- * (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>\r
- * All rights reserved\r
- *\r
- * This script is part of the TYPO3 project. The TYPO3 project is\r
- * free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * The GNU General Public License can be found at\r
- * http://www.gnu.org/copyleft/gpl.html.\r
- * A copy is found in the textfile GPL.txt and important notices to the license\r
- * from the author is found in LICENSE.txt distributed with these scripts.\r
- *\r
- *\r
- * This script is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * This copyright notice MUST APPEAR in all copies of the script!\r
- ***************************************************************/\r
-\r
-/**\r
- * The backend viewport configuration\r
- *\r
- * @author Stefan Galinski <stefan.galinski@gmail.com>\r
- */\r
-TYPO3.Viewport.configuration = {\r
- layout: 'border',\r
- id: 'typo3-viewport',\r
- renderTo: Ext.getBody(),\r
- border: false,\r
- items: [{\r
- region: 'north',\r
- id: 'typo3-toolbar',\r
- contentEl: 'typo3-top-container',\r
- border: false\r
- }, {\r
- layout: 'absolute',\r
- region: 'west',\r
- id: 'typo3-module-menu',\r
- contentEl: 'typo3-side-menu',\r
- width: 159,\r
- anchor: '100% 100%',\r
- border: false\r
- }, {\r
- region: 'center',\r
- layout: 'border',\r
- border: false,\r
- items: [{\r
- region: 'west',\r
- layout: 'absolute',\r
- id: 'typo3-navigationContainer',\r
- width: 300,\r
- anchor: '100% 100%',\r
- collapsible: true,\r
- collapseMode: 'mini',\r
- hideCollapseTool: true,\r
- animCollapse: false,\r
- split: true,\r
- autoScroll: true,\r
- hidden: true,\r
- border: false\r
- }, {\r
- region: 'center',\r
- layout: 'absolute',\r
- id: 'typo3-contentContainer',\r
- contentEl: 'typo3-content',\r
- anchor: '100% 100%',\r
- border: false\r
- }]\r
- }]\r
-};\r
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ * A copy is found in the textfile GPL.txt and important notices to the license
+ * from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * The backend viewport configuration
+ *
+ * @author Stefan Galinski <stefan.galinski@gmail.com>
+ */
+TYPO3.Viewport.configuration = {
+ layout: 'border',
+ id: 'typo3-viewport',
+ renderTo: Ext.getBody(),
+ border: false,
+ items: [{
+ region: 'north',
+ id: 'typo3-toolbar',
+ contentEl: 'typo3-top-container',
+ border: false
+ }, {
+ layout: 'absolute',
+ region: 'west',
+ id: 'typo3-module-menu',
+ contentEl: 'typo3-side-menu',
+ width: 159,
+ anchor: '100% 100%',
+ border: false
+ }, {
+ region: 'center',
+ layout: 'border',
+ border: false,
+ items: [{
+ region: 'west',
+ layout: 'absolute',
+ id: 'typo3-navigationContainer',
+ width: 300,
+ anchor: '100% 100%',
+ collapsible: true,
+ collapseMode: 'mini',
+ hideCollapseTool: true,
+ animCollapse: false,
+ split: true,
+ autoScroll: true,
+ hidden: true,
+ border: false
+ }, {
+ region: 'center',
+ layout: 'absolute',
+ id: 'typo3-contentContainer',
+ contentEl: 'typo3-content',
+ anchor: '100% 100%',
+ border: false
+ }]
+ }]
+};