/** * Main Controller for processMaker v2.x * @date Jul 17, 2011 * @author Erik Amaru Ortiz */ var Main = function() { return { /** properties */ panels : new Array(), configuration: {}, viewport : null, systemInfoWindow : null, /** init method */ init : function() { Ext.QuickTips.init(); Ext.form.Field.prototype.msgTarget = 'side'; this.configureComponents(); this.buildComponents(); this.viewport = new Ext.Viewport({ layout: 'border', items: [this.panels] }); Ext.getCmp('eastPanel').hide(); Ext.getCmp('westPanel').hide(); Ext.getCmp('southPanel').hide(); Ext.getCmp('northPanel').update(Ext.fly('header-content').dom.innerHTML); Ext.getCmp('centerPanel').ownerCt.doLayout(); Ext.get('options-tool').on('click', function(eventObj, elRef) { var conn = new Ext.data.Connection(); eventObj.stopEvent(); if (!this.ctxMenu) { Main.buildUserMenu(this); } this.ctxMenu.show(elRef); }); if (typeof flyNotify != 'undefined') { Ext.msgBoxSlider.msgTopCenter(flyNotify.type, flyNotify.title, flyNotify.text, flyNotify.time); } } } }(); Main.configureComponents = function() { this.configuration.eastPanel = { id:'eastPanel', region: 'east', width: 200, height: 500, minSize: 175, maxSize: 400, split: true, collapsible: true, items: [] }; this.configuration.centerPanel = { id:'centerPanel', region: 'center', layout: 'fit', width: 200, margins: '0 0 0 0' // top right botom left }; this.configuration.centerPanel.items = new Array(); this.configuration.centerPanel.items.push({ xtype:"tabpanel", id: 'mainTabPanel', defaultType:"iframepanel", enableTabScroll: true, activeTab: activeTab != '' ? activeTab : 0 }); this.configuration.westPanel = { id:'westPanel', title: '', region: 'west', width: 200, split: true, collapsible: true, items: [] }; this.configuration.northPanel = { id:'northPanel', region: 'north', height: 50, //applyTo: 'panel-header', margins: '0 0 0 0', // top right botom left items: [] }; this.configuration.southPanel = { id:'southPanel', region: 'south', height: 68, margins: '0 0 0 0', // top right botom left items: [] }; this.configuration.userMenu = {} this.configuration.userMenu.items = new Array(); if (switchInterface) { this.configuration.userMenu.items.push({ text : _("ID_SWITCH_INTERFACE"), iconCls: 'ss_sprite ss_arrow_switch', handler: function() { var url = '../uxs/home'; if (typeof parent != 'undefined') { parent.location.href = url; } else { location.href = url; } } }); } this.configuration.userMenu.items.push({ text : _("ID_VIEW_EDIT_PROFILE"), icon: '/images/profile-picture.png', handler: function() { Main._addTab('profile', 'Profile', 'users/usersInit'); } }); /*this.configuration.userMenu.items.push({ id:'skinMenu', text : _("ID_SKINS"), icon: '/images/icon-pmskins.png' });*/ if (showSystemInfo) { this.configuration.userMenu.items.push({ text : _('ID_SYSTEM_INFO'), icon: '/images/sys-info-icon.png', handler: systemInfo }); } this.configuration.userMenu.items.push({ text : _('ID_LOGOUT'), icon: '/images/logout.gif', handler: function() { location.href = 'main/login'; } }); }; Main.buildComponents = function() { var centerTabPanelItems = new Array(); for (var i=0; i