{:tpl head}
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>模块管理</caption>
  <tr>
   <td>
    <strong>管理选项：</strong>
    <a href="?c=module&a=add">安装模块</a> | <a href="?c=module">管理模块</a>
   </td>
  </tr>
</table>
<!--{:if $a == 'add' || $a == 'edit'}-->
<table cellpadding="0" cellspacing="1" class="table_form">
 <caption>{:if $a == 'add'}安装{:else}编辑{:/if}模块</caption>
 <form name="myform" action="?c=module&a={:$a}" method="post">
 <input type="hidden" name="info[id]" value="{:$data['id']}" />
 <input type="hidden" name="forward" value="{:$referer}" />
 <tr>
  <td width="20%" align="right">模块名称：</td>
  <td>
   <input name="info[title]" type="text" value="{:$data['title']}" size="20" maxlength="20" require="true" datatype="require" msg="名称不能为空" /> <span class="fred">*</span></td>
 </tr>
 <tr>
  <td width="20%" align="right">英文标识：</td>
  <td>
   <input name="info[name]" type="text" value="{:$data['name']}" size="20" maxlength="20"{:if $a == 'edit'} disabled="disabled"{:/if} require="true" datatype="require" msg="英文标识不能为空" /> <span class="fred">* 唯一</span><br /><span class="fblue">模块的安装(卸载)sql文件名与该设置一致</span></td>
 </tr>
 <tr>
  <td align="right">所在目录：</td>
  <td><input name="info[dir]" type="text" value="{:$data['dir']}" /><br /><span class="fblue">安装(卸载)时需要将SQL文件存放在该目录/Lib/Install(Uninstall)/</span></td>
 </tr>
 <tr>
  <td align="right">简要说明：</td>
  <td>
   <textarea name="info[description]" cols="56" rows="5">{:$data['description']}</textarea>
  </td>
 </tr>
 <!--{:if $a == 'add'}-->
 <tr>
  <td align="right">包含表名：</td>
  <td>
   <input name="info[tables]" type="text" size="73" value="{:$data['tables']}" /><br />
   <span class="fred">请设置完整数据表名(含前缀)，多个用|分隔，设置了在安装的时候可以检测是否已经存在！</span>
  </td>
 </tr>
 <!--{:/if}-->
 <tr>
  <td align="right">选项：</td>
  <td>
   <input type="checkbox" name="info[usecategory]" value="1"{:Tag::checked($data['usecategory'],1)}>分类功能&nbsp;
   <input type="checkbox" name="info[iscustomconfig]" value="1"{:Tag::checked($data['iscustomconfig'],1)}>自定义配置<br /><span class="fblue">其中自定义配置仅在需要自定义处理配置数据时使用</span>
  </td>
 </tr>
 <tr>
  <td>&nbsp;</td><td>
  <button type="submit" name="submit" value="submit">提交</button>
  <button type="button" name="back" value="back" onclick="history.back()">返回</button>
  <!--{:if $a == 'add'}-->
  <span class="fred">备注：简单模块可以没有数据表，即不含数据库功能</span>
  <!--{:/if}-->
  </td>
 </tr>
 </form>
</table>
<script type="text/javascript" src="../../statics/js/validator.js"></script>
<script type="text/javascript"> 
$(function(){$('form').checkForm(1);});
</script>
<!--{:elseif $a == 'defaults'}-->
<form name="myform" method="post" action="">
<input type="hidden" name="selids" value="">
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>管理模块</caption>
 <tr align="center">
  <th width="5%"><input name="checkbox" type="checkbox" onclick="checkorno(this,this.form.ids)" /></th>
  <th width="10%">名称</th>
  <th width="10%">标识</th>
  <th width="10%">目录</th>
  <th width="20%">说明</th>
  <th width="8%">排序</th>
  <th width="8%">分类</th>
  <th width="8%">状态</th>
  <th>管理操作</th>
 </tr>
 {:loop $data $v}
 <tr align="center">
  <td><input name="ids" type="checkbox" value="{:$v['id']}"></td>
  <td>{:$v['title']}</td>
  <td>{:$v['name']}</td>
  <td>{:$v['dir']}</td>
  <td align="left">{:$v['description']}</td>
  <td><input name="orderid[{:$v['id']}]" type="text" size="2" value="{:$v['orderid']}"></td>
  <td class="fgreen">{:if $v['usecategory']}√{:/if}</td>
  <td>{:if $v['state']}<span class="fgreen">√</span>{:else}<span class="fred">×</span>{:/if}</td>
  <td>{:if $v['state']}<a href="?c=module&a=state&val=0&id={:$v['id']}" title="禁用模块">禁用</a>{:else}<a href="?c=module&a=state&val=1&id={:$v['id']}" title="启用模块" class="fred">启用</a>{:/if}&nbsp;|&nbsp;<a href="?c=module&a=edit&id={:$v['id']}">编辑</a>&nbsp;|&nbsp;{:if $v['issystem']}<span class="fgray">删除</span>{:else}<a href="?c=module&a=del&id={:$v['id']}">删除</a>{:/if}&nbsp;|&nbsp;{:if $v['useconfig']}<a href="?c={:if $v['iscustomconfig']}$v['name']{:else}module{:/if}&a=config&id={:$v['id']}">配置</a>{:else}<span class="fgray">配置</span>{:/if}
  </td>
 </tr>
 {:/loop}
 <tr>
  <td height="20" colspan="9" align="center">
   <button name="select1" onClick="selAll(this.form.ids)" type="button">全选</button>
   <button name="select2" onClick="noSelAll(this.form.ids)" type="button">反选</button>
   <button name="order" type="button" onClick="subform(this.form,this.form.ids,'?c=module&a=order','')">排序</button>
   <button name="reset" type="reset">重置</button>
  </td>
 </tr>
</table>
</form>
{:if $pages}<div class="pages">{:$pages}</div>{:/if}
<!--{:/if}-->
{:tpl foot}