<table width="100%" class="topmenu">
	<tr><td>
		{?if $row.status==1?}<a href="article.php"><em>文章列表</em></a>{?section name=i loop=$catepos?}<span>></span><a href="article.php?cid={?$catepos[i].cid?}">{?$catepos[i].cname?}</a>{?/section?}
		{?elseif $row.status==2?}<a href="pending.php?status=2"><em>审核不通过文章</em></a>{?section name=i loop=$catepos?}<span>></span><a href="pending.php?cid={?$catepos[i].cid?}&status=2">{?$catepos[i].cname?}</a>{?/section?}
		{?else?}<a href="pending.php"><em>待审核文章</em></a>{?section name=i loop=$catepos?}<span>></span><a href="pending.php?cid={?$catepos[i].cid?}">{?$catepos[i].cname?}</a>{?/section?}
		{?/if?}<span>></span>
		<a href="addarticle.php?aid={?$row.aid?}"><em>{?$row.title?}</em></a><span>></span>
		<a href="chapter.php?aid={?$row.aid?}"><em>章节管理</em></a><span>></span>
		{?if $row.chapterid>0?}修改{?else?}增加{?/if?}{?if $isvolume==1?}分卷{?else?}章节内容{?/if?}
	</td></tr>
</table><br>
<form id="formAdd" method="post">
<input type="hidden" name="dosubmit" value="1">
<input type="hidden" name="aid" value="{?$row.aid?}" />
<input type="hidden" name="isvolume" value="{?$isvolume?}" />
<input type="hidden" name="timeline" value="{?$saxue_time?}">
{?if $row.chapterid>0?}<input type="hidden" name="chapterid" value="{?$row.chapterid?}">{?/if?}
<table width="100%" class="grid">
	<tr>
		<td class="tdleft" width="80">文章名称：</td>
		<td>{?$row.title?}</td>
	</tr>
	{?if $isvolume==1?}
	<tr>
		<td class="tdleft">分卷标题：</td>
		<td><input name="chaptername" id="chaptername" type="text" value="{?$row.chaptername?}" size="80" class="text" maxlength="50" /></td>
	</tr>
	{?else?}
	<tr>
		<td class="tdleft">章节标题：</td>
		<td><input name="chaptername" id="chaptername" type="text" value="{?$row.chaptername?}" size="80" class="text" maxlength="50" /></td>
	</tr>
	<tr>
		<td class="tdleft">章节内容：</td>
		<td>{?function saxue_geteditor:'chaptercontent':680:380:'default':$saxue_time?}<textarea name="chaptercontent" id="chaptercontent">{?$row.chaptercontent?}</textarea></td>
	</tr>
	<tr>
		<td class="tdleft">内容选项：</td>
		<td>
			<label><input name="auto_remote" type="checkbox" value="1" checked />下载非本站图片到本地</label>&nbsp;
			<label><input name="auto_link" type="checkbox" value="1" checked />清除非本站链接</label>&nbsp;<br>
			<label><input name="auto_format" type="checkbox" value="1" checked />自动排版</label>&nbsp;<span class="gray">（过滤&lt;a&gt;&lt;img&gt;&lt;embed&gt;&lt;strong&gt;&lt;h&gt;&lt;pre&gt;&lt;object&gt;之外的所有HTML标签，并插入内文广告）</span>
		</td>
	</tr>
	{?/if?}
	<tr>
		<td class="tdleft"></td>
		<td><input type="submit" name="submit" id="submit" class="button" value="提 交"/></td>
	</tr>
</table>
</form>
<script type="text/javascript">
$(function(){
	$("#formAdd").ajaxForm({
		beforeSubmit : function(){
			{?if $isvolume==1?}
			if ($("#chaptername").val()=='') {
				doTip('请输入分卷标题');
				$("#chaptername").focus();
				return false;
			} 
			{?else?}
			if ($("#chaptername").val()=='') {
				doTip('请输入章节标题');
				$("#chaptername").focus();
				return false;
			} 
			if(e_chaptercontent.isEmpty()) {
				doTip('请输入章节内容');
				return false;
			}
			{?/if?}
		},
        dataType: "json",
        success : function(data){
			if(data.flag == 0){
				doTip(data.msg);
			}else{
				if(confirm("章节内容保存成功！是否继续添加章节？\n\n选择“确定”继续添加\n选择“取消”返回章节列表页面")){
					location.href='addchapter.php?aid={?$row.aid?}';
				}else{
					location.href='chapter.php?aid={?$row.aid?}';
				}
			}
        }
    });
})
</script>