<?php
	!defined('IN_MANAGE') && exit('Access Denied!');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="admin/template/images/tm_right.css" type="text/css" rel="stylesheet" />
<link href="statics/ui-jquery/jquery-ui.css" type="text/css" rel="stylesheet" />
<title>网站后台管理</title>
<script language="javascript" src="statics/ui-jquery/jquery-1.8.3.js"></script>
<script language="javascript" src="statics/ui-jquery/jquery-ui.js"></script>
<script language="javascript" src="admin/template/images/tm-core.js"></script>
</head>

<body>
	<div class="top-tips">
		<div class="tips-wrap">
			<div class="title">模块管理</div>
			在这里可以对网站已安装功能模块进行管理。<a href="<?php echo IN_SYS;?>" target="_blank" style="color:#FF0000">获取帮助</a>
		</div>
	</div>
	<div class="manage-tips">
	<a href="###" onclick="$('#myform').attr('action','?mod=config&file=config&action=module_disabled&status=0');$('#myform').submit();" class="del">禁用模块</a>
	<a href="###" onclick="$('#myform').attr('action','?mod=config&file=config&action=module_disabled&status=1');$('#myform').submit();" class="pass">启用模块</a>
	<a href="?mod=config&file=config&action=module_import" class="add">安装模块</a>
	<a href="?mod=config&file=config&action=module_install" class="top">自定义模块</a>
	</div>
	<form action="" method="post" name="myform" id="myform">
	<input type="hidden" name="do_submit" value="1" />
	<table class="table-list" cellpadding="1" cellspacing="1">
		<tr>
			<th><input id="checkAll" title="全选/反选" type="checkbox" /></th>
			<th>ID</th>
			<th>模块名称</th>
			<th>更新日期</th>
			<th>模块作者</th>
			<th>模块状态</th>
			<th>系统模块</th>
			<th>操作</th>
		</tr>
		<?php if($result){foreach($result as $no =>$val){?>
		<tr <?php if($no%2==0){?>class="light"<?php }?>>
			<td><input type="checkbox" name="id[]" <?php echo $val['issystem']?'':'la="checkbox"';?> value="<?php echo $val['id'];?>" <?php echo $val['issystem']?'disabled="disabled"':'';?> /></td>
			<td><?php echo $val['id'];?></td>
			<td><?php echo $val['name'];?></td>
			<td><?php echo $moduleobj->version($val['folder']);?></td>
			<td title="<?php echo $val['author'];?>"><?php echo $val['author'];?></td>
			<td><span class="<?php echo $val['status']?'passed':'unpass';?>"><?php echo $val['status']?'已启用':'已禁用';?></span></td>
			<td><?php echo $val['issystem']?'系统':'自定义';?></td>
			<td><a href="?mod=config&file=config&action=module_setting&id=<?php echo $val['id'];?>">配置</a> <?php if(!is_file(SYSTEM_ROOT.$val['folder'].'/upgrade.sql')){echo '<a href="###" onclick="alert(\'该模块已是最新版本，无需更新\')">暂无更新</a>';}else{?><a style="color:#FF0000" href="?mod=config&file=config&action=module_upgrade&id=<?php echo $val['id'];?>">有新版本</a><?php }?> <?php if(!$val['issystem']){?><a href="?mod=config&file=config&action=module_export&id=<?php echo $val['id'];?>">导出</a><?php }else{echo '<a href="###" onclick="alert(\'系统模块不允许导出\')">导出</a>';}?> <?php if(!$val['issystem']){?><a href="?mod=config&file=config&action=module_uninstall&id=<?php echo $val['id'];?>">卸载</a><?php }else{echo '<a href="###" onclick="alert(\'系统模块不允许卸载\')">卸载</a>';}?></td>
		</tr>
		<?php }?>
		<tr class="page">
			<td colspan="8">
			<?php echo $moduleobj->pagestring;?>
			</td>
		</tr>
		<?php }else{?>
			<tr><td colspan="8" bgcolor="#FFFFFF">暂未安装任何模块</td></tr>
		<?php }?>
		
	</table>
	</form>
</body>
</html>
