<?php

/*
*	Copyright VeryIDE,2007-2010
*	http://www.veryide.com/
*
*	$Id: veryide.setting.php,v2 19:47 2008-2-21 Leilei $
*/

require("../../include/header.php");

html_start("系统设置 - VeryIDE");
?>

<!--body start-->
	<?php
    
    //loader
    loader_setting("naver.system");
	
		
	//服务器扩展检测
	//checker_class("XSLTProcessor");
	
	require_once("../../class/setting.php");

	//检查权限
	$func = "sys-setting-system";
	checker_func($func);
	
	$do = GetQuery("do");
	
	if( !$do ) header("location: ?do=setting");
	
	$active = array('setting','ftp','mail');
	
	if( in_array( $do , $active ) ){
		
		$_GalSet = new Setting(VI_ROOT.'config/'.$do.'.php' , VI_ROOT.'config/'.$do.'.xml' , $do);
		
		if( $_GET["action"]=="update" && !empty($_POST) ){
			if($_GalSet->save('POST')){		
					
				//写入日志
				event_insert($mysql,$func,time(),time());
				
				//$Project["message"]="成功修改系统配置！";
				
				echo '<div id="state">成功修改系统配置，请刷新查看最新效果：<input name="submit" onclick=\'parent.location.reload(true)\' type="button" class="submit" value="刷新此页面" /></div>';
				
			}else{
				
				//$Project["message"]="保存系统配置失败！";
				echo "<div id='state' class='failure'>保存系统配置失败！请检查 veryide/config/ 目录有允许写权限</div>";
				
			}
			
		}
		
		$form = $_GalSet->transform();
		
	}
	
	
    ?>

    <!--div id="board">
        <img src="image/icon/gear_48.png" class="logo" />
        <?php echo $Project["support"];?>
        <p>
            <span class="text-key">VeryIDE 系统设置</span><br>
            配置系统全局,个性化定制适合自己的 VeryIDE<br>
            <?php 
			if($_POST["action"]=="update"){
				echo '<input name="submit" onclick=\'parent.location.reload(true)\' type="button" class="submit" value="刷新看效果" />';
			}
			?>
        </p>
    </div-->
    
	<div id="box">
		<form method="post" action="?do=<?php echo $do;?>&action=update" mode="edit" verify="true">
        
        <table cellpadding="0" cellspacing="0" class="form">
        
		<?php
	
		echo $form;
		
		
		/*
		//$_GalSet = new Setting(VI_ROOT.'source/template/setting.xslt',VI_ROOT.'config/setting.xml');		
		$_GalSet = new Setting(VI_ROOT.'config/setting.php' , VI_ROOT.'config/setting.xml' , 'system');
		//$_GalSet = new Setting('resources\template/setting.xslt','config/setting.xml');		
		
		if($_POST["action"]=="update"){
		
			//检查权限
			$func = "sys-system-setting";
			checker_func($func);
		
			if($_GalSet->save('POST')){		
					
				//写入日志
				event_insert($mysql,$func,time(),time());
				
				$Project["message"]="成功修改系统配置！";
				
				echo '<script>parent.location.reload(true);</script>';
				
				
			}else{
				
				$Project["message"]="保存系统配置失败！";
				
			}
			
		}
		
        echo $_GalSet->transform();
        //$s->save();
		
		*/
        
        ?>
        <tr class="nobr">
            <td><strong></strong></td>
            <td>
                <input type="submit" name="" value="保存配置" class="submit" />
            </td>				
        </tr>
            
		</table>
		  
		</form>
	</div>


<!--body end-->

<?php html_close();?>