<?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>
<script type="text/javascript">
$(document).ready(function(){
	if(<?php echo $info['inmember'];?>)
	{
		$('#membody').show();
	}
	else
	{
		$('#membody').hide();
	}
});
var i=0,j=0;


function add_admin_menu()
{
	var admin_menu='<div style="background:#FFFFCC; padding:4px; border:#FFCC00 1px solid; margin-bottom:4px; line-height:22px"><strong>菜单设置：</strong>?mod=<?php echo $info['folder'];?>&amp;file=<?php echo $info['folder'];?>&amp;action=<input type="text" name="info[admin-key]['+i+']" class="input-txt-noborder" style="font-weight:normal;" size="6" /> | <input type="text" class="input-txt-noborder" name="info[admin-name]['+i+']" size="10" /><br /><strong>权限设置：</strong><?php foreach($admrole as $k => $_r){?><label title="选中<?php echo $r['name'];?>"><input type="checkbox" value="<?php echo $_r['id'];?>" name="info[admin-role]['+i+'][]" /><?php echo $_r['name'];?></label><?php }?></div>';
	i++;
	$('#appendhtml').append(admin_menu);
}
</script>
</head>

<body>
	<div class="top-tips">
		<div class="tips-wrap">
			<div class="title">配置模块</div>
			在这里可以配置网站功能模块参数
		</div>
	</div>
	<form action="" method="post" name="myform">
	<input type="hidden" name="do_submit" value="1" />
	<input type="hidden" name="id" value="<?php echo $id;?>" />
	<table class="table-wrap" cellpadding="0" cellspacing="0">
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name" width="18%">模块名称<span>*</span></td>
			<td><input type="text"  name="info[name]" value="<?php echo $info['name'];?>" title="请输入您的模块名称" class="input-txt" size="45" /></td>
			<td class="tb-tips" >请输入您的模块名称</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">模块作者<span>*</span></td>
			<td><input type="text" name="info[author]" value="<?php echo $info['author'];?>"  title="请输入您的模块作者"class="input-txt" size="45" /></td>
			<td class="tb-tips">请输入您的模块作者</td>
		</tr>
		
			<span id="mappendhtml"></span>
			
		</tbody>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">管理权限设置<span>*</span></td>
			<td>
			<?php
				foreach($admrole as $r)
				{
					$v=explode(',',$info['adminrole']);
			?>
			<label title="选中<?php echo $r['name'];?>"><input type="checkbox" <?php echo in_array($r['id'],$v)?' checked="checked"':'';?> value="<?php echo $r['id'];?>" name="info[adminrole][]" /><?php echo $r['name'];?></label> &nbsp;&nbsp;
			<?php
				}
			?>
			</td>
			<td class="tb-tips">请选择管理权限</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">后台管理菜单<span>*</span></td>
			<td>
			<?php
			foreach($adminmenus as $key => $r){
			?>
			<div style="background:#FFFFCC; padding:4px; border:#FFCC00 1px solid; margin-bottom:4px; line-height:22px">
			<strong>菜单设置：</strong>
			?mod=<?php echo $info['folder'];?>&amp;file=<?php echo $info['folder'];?>&amp;action=<input type="text" readonly="1" name="info[admin-key][<?php echo $key;?>]" class="input-txt-noborder" style="font-weight:normal; border:0px" size="6" value="<?php echo $key;?>" /> | <input type="text" class="input-txt-noborder" name="info[admin-name][<?php echo $key;?>]" size="10" title="此处留空则表示删除选项" value="<?php echo $r['name'];?>" /><br />
			<strong>权限设置：</strong>
			<?php
				foreach($admrole as $_r)
				{
					$v=explode(',',$r['role']);
			?>
			
			<label title="选中<?php echo $r['name'];?>"><input type="checkbox" <?php echo in_array($_r['id'],$v)?' checked="checked"':'';?> value="<?php echo $_r['id'];?>" name="info[admin-role][<?php echo $key;?>][]" /><?php echo $_r['name'];?></label> 
			<?php }?>
			</div>
			<?php }?>
			<span id="appendhtml"></span>
			<a href="javascript:void();" onclick="add_admin_menu();">添加菜单</a>
			</td>
			<td class="tb-tips">请设置后台管理菜单</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">数据表名称<span>*</span></td>
			<td><input type="text" name="info[dbtable]" title="请输入模块数据表名称" value="<?php echo $info['dbtable'];?>" class="input-txt" size="67" /></td>
			<td class="tb-tips">请输入模块数据表名称</td>
		</tr>
		<tr>
			<td bgcolor="#EFF7FF" class="tb-name">使用说明<span>*</span></td>
			<td><textarea cols="65" rows="8" name="info[rules]" class="input-txtarea"><?php echo $info['rules'];?></textarea></td>
			<td class="tb-tips">模块使用说明</td>
		</tr>
		<tr>
			<td colspan="3" class="save-td"><input type="submit" name="dosubmit" class="save-btn" value="保存设置" /></td>
		</tr>
	</table>
	</form>
</body>
</html>
