<form id="formAdd" method="post" action="?action=add">
<input type="hidden" name="dosubmit" value="1">
{?if $row.id>0?}<input type="hidden" name="id" value="{?$row.id?}">{?/if?}
<table width="100%" class="grid">
	<tr>
		<td class="tdleft" width="100"><span class="red">*</span> 规则名称：</td>
		<td><input type="text" class="text" name="name" id="name" size="30" maxlength="20" value="{?$row.name?}" /></td>
	</tr>
	<tr>
		<td class="tdleft"><span class="red">*</span> 所属模块：</td>
		<td><select name="modid"><option value="0">通用</option>{?section name=i loop=$modules?}<option value="{?$i['key']?}"{?if $i['key']==$row.modid?} selected{?/if?}>{?$modules[i].name?}</option>{?/section?}</select></td>
	</tr>
	<tr>
		<td class="tdleft"><span class="red">*</span> URL类型：</td>
		<td><select name="type">{?section name=i loop=$urltype?}<option value="{?$i['key']?}"{?if $i['key']==$row.type?} selected{?/if?}>{?$i['value']?}</option>{?/section?}</select></td>
	</tr>
	<tr>
		<td class="tdleft"><span class="red">*</span> URL示例：</td>
		<td><input type="text" class="text" name="example" id="example" size="60" maxlength="255" value="{?$row.example?}" /></td>
	</tr>
	<tr>
		<td class="tdleft"><span class="red">*</span> URL规则：</td>
		<td><input type="text" class="text" name="urlrule" id="urlrule" size="60" maxlength="255" value="{?$row.urlrule?}" /><br><span class="red">列表第一页规则不同时用 | 分割添加</span></td>
	</tr>
	<tr>
		<td class="tdleft">可用变量：</td>
		<td>栏目目录：<{$catdir}>，分页：<{$page}>，父栏目：<{$parentdir}><br>栏目ID：<{$catid}>，内容ID：<{$id}></td>
	</tr>
</table>
<div><input type="submit" name="submit" id="submit" class="button dodialog" value="提 交"/></div>
</form>
<script type="text/javascript">
$(function(){
	$("#formAdd").ajaxForm({
        dataType: "json",
        success : function(data){
			if(data.flag == 0){
				doTip(data.msg);
			}else{
				window.top.mainframe.location.reload();
				doDialogClose();
			}
        }
    });
})
</script>