 
Ext.BLANK_IMAGE_URL = './ext/resources/images/default/s.gif';
Ext.ns('GeoPrisma');
 
GeoPrisma.app = new Ext.App({});
 
// application main entry point
Ext.onReady(function() {
 
    Ext.QuickTips.init();
    Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
    
   
    var snifferGrid = new GeoPrisma.Test.Sniffer.Grid();
    var snifferStateView = new GeoPrisma.Test.Sniffer.DataView();
    var homeSnifferStateView = new GeoPrisma.Test.Sniffer.DataView();
  
    var phpUnitGrid = new GeoPrisma.Test.PHPUnit.Grid();
    var phpUnitStateView = new GeoPrisma.Test.PHPUnit.DataView(); 
    var homePhpUnitStateView = new GeoPrisma.Test.PHPUnit.DataView();
    
    var viewport = new Ext.Viewport(   
    {
        layout: 'fit',
        border: false,
        items: [    
        {
            layout: 'border',
            border: false,
            items: [{
                region: 'north',
                height: 50,
                xtype: 'container',
                border: false,
                items : [{      
                    xtype : 'box',
                    autoEl: {tag: 'img', src: 'img/geoprisma.png'}
                }]              
            },{
                region: 'center',
                xtype: 'tabpanel', // TabPanel itself has no title
                activeTab: g_activeTab,

                items: [{
                    title: 'Home', 
                    
                    defaults: {cls: "common", border: false},
                    xtype:'portal',
                    region:'center',
                    margins:'35 5 5 0',
                    items:[{
                        columnWidth:.66,
                        style:'padding:10px 0 10px 10px',
                        items:[{
                            title: 'Samples (1.3.0-dev)',
                            layout:'fit',
                            xtype:'fieldset', 
                            style:'padding:2px 0 0 0',
                            items: { 
                                border: false,
                                xtype      : 'panel',
                                height     : 500,
                                autoScroll : true,
                                cls        : 'all-demos',
                                items : new GeoPrisma.Sample.DataView({autoHeight: false, height:400})
                            }
                        }]
                    },{
                        columnWidth: .33,
                        style:'padding:10px 0 10px 10px',
                        items:[{
                            xtype:'fieldset', 
                            title: 'Download',
                            layout:'fit',
                            items: new GeoPrisma.Download.Panel()
                        },{
                            xtype:'fieldset', 
                            title: 'Documentation',
                            layout:'fit',
                            items: { 
                                border: false,
                                xtype: 'panel',
                                html: '<a href="/docs/1.2" target="_blank">Current Release (1.2.0)</a><br />' +
                                      '<a href="../dist/build/html/index.html" target="_blank">Developement</a><br />' +
                                      '<a href="/docs" target="_blank">All Releases</a><br/>'
                            }
                        },{
                            xtype:'fieldset',
                            title: 'Development',
                            layout:'fit',
                            items: {
                                border: false,
                                xtype: 'panel',
                                html: '<a href="http://trac.osgeo.org/geoprisma/" target="_blank">Issue Tracker</a><br/>' +
                                      '<a href="https://svn.osgeo.org/geoprisma/projects/geoprisma" target="_blank">SVN Repository</a><br/>'
                            }
                        },{
                            xtype:'fieldset',
                            title: 'Community',
                            layout:'fit',
                            items: { 
                                border: false,
                                xtype: 'panel',
                                html:
                                     '<a href="http://lists.osgeo.org/mailman/listinfo/geoprisma-dev" target="_blank">GeoPrisma-dev mailing list</a><br/>'+
                                     '<a href="http://n3.nabble.com/GeoPrisma-dev-f25947.html" target="_blank">GeoPrisma-dev on Nabble</a><br/>'+
                                     '<a href="http://lists.osgeo.org/mailman/listinfo/geoprisma-users" target="_blank">GeoPrisma-users mailing list</a><br/>'+
                                     '<a href="http://n3.nabble.com/GeoPrisma-users-f26231.html" target="_blank">GeoPrisma-users on Nabble</a>'                
                            }
                        },{
                            xtype:'fieldset',
                            title: 'Release Webpages',
                            layout:'fit',
                            items: {
                                border: false,
                                xtype: 'panel',
                                html: 'For samples consultation<br />'+
                                      '<a href="/1.2" target="_blank">Current Release (1.2.0)</a><br/>'+
                                      '<a href="/1.0" target="_blank">Past Release (1.0.0)</a><br/>'
                            }
                        },{ 
                                xtype:'fieldset', 
                                title: 'Code sniffer state',
                                height:120,
                                items : [homeSnifferStateView]
                            }                                    
                        ] 
                    }]           
                },{
                    title: 'Download',
                    layout:'fit',
                    style:'padding:10px 0 10px 10px',
                    items: new GeoPrisma.Download.Panel({full: true})
                },{
                    title: 'Documentation',
                    xtype: 'panel',
                    layout : 'fit',
                    items: {
                        xtype : 'box',
                        autoEl: {id : 'php_gen_iframe', tag: 'iframe', src: '../dist/build/html/index.html'}
                    }
                },{
                    title: 'Samples',
                    xtype:'panel',
                    autoScroll : true,
                    layout:'anchor',
                    items:[ 
                        { 
                            border: false,
                            xtype:'panel',                                
                            autoHeight:true,
                            cls: 'all-demos',
                            items : new GeoPrisma.Sample.DataView()
                        }
                        
                    ]                    
                    
                },{
                    title: 'Code sniffer',
                    xtype: 'panel',
                    padding:'10',
                    layout: {
                                type:'vbox',
                                align:'stretch'
                            },
                    items: [{
                        height:20,
                        layout: 'fit',
                        xtype : 'box',
                        autoEl: {tag: 'div', html: 'Code sniffer checks programming rules in php files and lists all errors and warnings'}
                    },{
                        height:120,
                        layout: 'fit',
                        title:'State',
                        xtype : 'panel',
                        frame : true,
                        margins:'0 0 5 0',
                        items: [snifferStateView] 
                    },{
                        flex:1,
                        layout: 'fit',
                        title:'Error & Warning list',
                        xtype : 'panel',
                        items: [snifferGrid]
                    }]
                },{
                    title: 'Contributors',
                    autoLoad:'contributors.html'
                },{
                    title: 'License',
                    autoLoad:'../license/index.html'
                } ]
            }]
        }]
    });   

}); // eo function onReady
 
// eof

