<?php

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

require '../../include/loader.php';

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

<!--body start-->

	<style>
		html,body,#wrapper{ overflow:hidden; padding:0; margin:0;}	
	</style>

	<script type="text/javascript">
	
		var Reload = function(){
			location.reload();	
		}
	
		var Resize = function(){
			var body = document.documentElement;
			var w = body.clientWidth;
			var h = body.clientHeight;
			
			if( w < 200 || h <= 200 ) return;
		
			Mo("#panel").style({"height":h+"px"});	
			
			Mo("#vessel").style({"width":(w-160)+"px","height":h+"px"});	
		};
		
		
		var Execute = function( link ){
			
			Mo("#vessel").html('<iframe src="'+ link +'" frameborder="0"></iframe>');
			
			Resize();
			
		};
	
		Mo.reader(function(){
						   
			Mo("#panel li a").bind("click",function(){
			
				//置灰全部
				Mo("#panel li a").attr({"class":""});
													
				//高亮当前
				Mo( this ).attr({"class":"active"});
				
				Execute( Mo.get("link", this.href ) );
													
			});
			
			/////////////////////
			
			if( Mo.get("link") ){
				Mo("#panel li a[href='#link="+ Mo.get("link") +"']").click();
			}else{
				Mo("#panel li a[rel=first]").click();
			}
			
		});
		
		Mo.resize( Resize );
	
	</script>

	<dl id="panel">
    	<dt><img src="<?php echo VI_BASE.'image/refresh.gif';?>" onclick="Reload();" />系统设置</dt>
        <dd>
        	<ul>
            	<li><a href="#link=system.setting.php?do=global" rel="first"><img src="<?php echo VI_BASE.'image/extra/settings.png';?>" class="icon" />全局设置</a></li><li><a href="#link=system.setting.php?do=attach"><img src="<?php echo VI_BASE.'image/extra/installer.png';?>" class="icon" />附件设置</a></li><li><a href="#link=system.setting.php?do=mail"><img src="<?php echo VI_BASE.'image/extra/mail.png';?>" class="icon" />邮件设置</a></li><li><a href="#link=data.update.php"><img src="<?php echo VI_BASE.'image/extra/timecapsule.png';?>" class="icon" />更新管理</a></li><li><a href="#link=data.backup.php"><img src="<?php echo VI_BASE.'image/extra/services.png';?>" class="icon" />数据备份</a></li><li><a href="#link=system.secure.php"><img src="<?php echo VI_BASE.'image/extra/sodoku.png';?>" class="icon" />安全优化</a></li><li><a href="#link=system.server.php"><img src="<?php echo VI_BASE.'image/extra/term1.png';?>" class="icon" />系统信息</a></li><li><a href="#link=system.licence.php"><img src="<?php echo VI_BASE.'image/extra/superpong.png';?>" class="icon" />版本验证</a></li></ul>
        </dd>
    	<dt><img src="<?php echo VI_BASE.'image/refresh.gif';?>" onclick="Reload();" />模块设置</dt>
        <dd>
        	<ul>
            	<?php
		foreach($_CACHE['system']['module'] as $appid=>$val){
			
			//当前模块目录
			$base = VI_ROOT.$_G['project']['module'].$appid;
			
			//有配置项
			if( file_exists($base.'/setting.xml') ) {
				echo '<li>'. ( !file_exists($base.'/setting.php') ? '<img src="'.VI_BASE.'image/warning.gif" class="warn" />' : '' ) .'<a href="#link=module.setting.php?appid='.$appid.'"><img src="'.VI_BASE.$_G['project']['module'].$appid.'/icon.png" class="icon" />'.$val["name"].'</a></li>';
			}
			
		}
		?>
            </ul>
        </dd>
    </dl>

	<div id="vessel">
    
    
    </div>
	
<!--body end-->

<?php html_close();?>