<table width="100%" class="topmenu">
	<tr><td>
		<a href="pages.php"><em>单页管理</em></a><span>|</span>
		<a href="?action=add" class="on"><em>添加单页</em></a><span>|</span>
		<a href="?action=cache"><em>更新菜单缓存</em></a>
	</td></tr>
</table>
<form id="formAdd" method="post" action="?action=add" onsubmit="return checkform()">
{?if $row.id>0?}<input type="hidden" name="id" value="{?$row.id?}">{?/if?}
<input type="hidden" name="dosubmit" value="1">
	<table width="100%" class="grid">
		<tr>
			<td class="tdleft" width="100"><span class="red">*</span>&nbsp;分组标识</td>
			<td><input type="text" class="text" name="item" id="item" maxlength="20" value="{?$row.item?}" onkeyup="value=value.replace(/[^a-z]/g,'');" />&nbsp;<span class="gray">英文字母，相关单页放在一组内方便调用，例如帮助分组“help”，关于分组“about”</span></td>
		</tr>
		<tr>
			<td class="tdleft"><span class="red">*</span>&nbsp;单页标题</td>
			<td><input type="text" class="text" name="title" id="title" size="50" maxlength="100" value="{?$row.title?}"/></td>
		</tr>
		<tr>
			<td class="tdleft"><span class="red">*</span>&nbsp;单页内容</td>
			<td>{?function saxue_geteditor:'content':700:400:'dedault'?}<textarea name="content" id="content">{?$row.content?}</textarea></td>
		</tr>
		<tr>
			<td class="tdleft">保存目录</td>
			<td><input type="text" class="text" name="htmldir" id="htmldir" size="50" value="{?$row.htmldir?}" />&nbsp;<span class="gray">留空保存在网站根目录，结尾不加斜线</span></td>
		</tr>
		<tr>
			<td class="tdleft">目录访问URL</td>
			<td><input type="text" class="text" name="htmlurl" id="htmlurl" size="50" value="{?$row.htmlurl?}" />&nbsp;<span class="gray">访问保存目录的URL，留空系统自动判断，结尾不加斜线</span></td>
		</tr>
		<tr>
			<td class="tdleft">PC端文件名</td>
			<td><input type="text" class="text" name="filename" id="filename" size="50" value="{?$row.filename?}" />&nbsp;<span class="gray">留空则以ID.html格式命名，PC端模版调用url</span></td>
		</tr>
		<tr>
			<td class="tdleft">PC端模板</td>
			<td>
				<select name="template"><option value="">不生成</option>{?section name=i loop=$temps?}<option value="{?$i['value']?}"{?if $i['value']==$row.template?} selected{?/if?}>{?$i['value']?}</option>{?/section?}</select>
				&nbsp;<span class="gray">{?$Saxue.saxue_theme_path?}/pages下的模板文件</span>
			</td>
		</tr>
		<tr>
			<td class="tdleft">手机端文件名</td>
			<td><input type="text" class="text" name="mfilename" id="mfilename" size="50" value="{?$row.mfilename?}" />&nbsp;<span class="gray">不可和PC端一样，建议htm结尾，留空则以ID.htm格式命名，手机端模版调用murl</span></td>
		</tr>
		<tr>
			<td class="tdleft">手机端模板</td>
			<td>
				<select name="mtemplate"><option value="">不生成</option>{?section name=i loop=$mtemps?}<option value="{?$i['value']?}"{?if $i['value']==$row.mtemplate?} selected{?/if?}>{?$i['value']?}</option>{?/section?}</select>
				&nbsp;<span class="gray">{?$mtemp_path?}下的模板文件</span>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td><input type="submit" class="button" name="submit" value="提交保存" /></td>
		</tr>
	</table>
</form>
<script>
function checkform(){
	if($('#item').val()==''){
		alert('请输入分组标识');
		$('#item').focus();
		return false;
	}
	if($('#title').val()==''){
		alert('请输入单页标题');
		$('#title').focus();
		return false;
	}
	if(e_content.isEmpty()){
		alert('请输入单页内容');
		e_content.focus();
		return false;
	}
	if($('#filename').val()!='' && $('#filename').val()==$('#mfilename').val()){
		alert('PC端和手机端文件名不能相同');
		$('#mfilename').focus();
		return false;
	}
}
</script>