<?php
include_once("_dirinfo.php");
include_once(PATH_TO_ROOT."init.php");

$dbConfigPaths = configLoader::loadConfig('paths');
if ($dbConfigPaths['live_update_www'] == "http://") $dbConfigPaths['live_update_www'] = "http://{your-server}/warpit";
if ($dbConfigPaths['live_update_zip_files_remote'] == "http://") $dbConfigPaths['live_update_zip_files_remote'] = "http://{your-server}/webProjects/LiveUpdate/";
?>

 new Ext.Window({
                id:'CapiPropWindow',
                layout:'fit',
                title: 'Capi Properties',
                width:600,
                height:140,
                modal: true,
                closeAction:'close',
                plain: true,
                items:
                	new Ext.FormPanel({
				        labelWidth	:	170, // label settings here cascade unless overridden
				        url			:	'_ajax/ajax.live-update-setup.php',
				        frame		:	false,
				        id			: 	'CapiPropForm',
				        defaultType	: 	'textfield',
						bodyStyle	:	'padding:5px 5px 0',
				        items: [
				        	{
				                fieldLabel: 'Main Server WWW address',
				                name: 'data[live_update_www]',
				                value: '<?php echo $dbConfigPaths['live_update_www']; ?>',
				                anchor : '100%'
				            }
				            ,{
				                fieldLabel: 'Main Server Files Location',
				                name: 'data[live_update_zip_files_remote]',
				                anchor : '100%',
				                 value: '<?php echo $dbConfigPaths['live_update_zip_files_remote']; ?>'
				               
				            }
				        ],
				
				        buttons: [{
				            text: 'Save',
				            handler: function() {
				            	Ext.getCmp('CapiPropForm').getForm().submit();
				            	//Ext.getCmp('CapiPropWindow').close();	
				            }
				        }]
				  	})
            }).show()