{?set $jieqi_pagetitle = "编辑小说-{$jieqi_sitename}"?}
{?set $jieqi_contenttitle = "编辑小说"?}

<script type="text/javascript">
function frmarticleedit_validate(){
  if(document.frmarticleedit.sortid.value == ""){
    alert("请输入类别");
    document.frmarticleedit.sortid.focus();
    return false;
  }
  if(document.frmarticleedit.articlename.value == ""){
    alert("请输入小说名称");
    document.frmarticleedit.articlename.focus();
    return false;
  }
}
</script>

<form class="form" name="frmarticleedit" id="frmarticleedit" action="{?$url_articleedit?}" method="post" onsubmit="return frmarticleedit_validate();" enctype="multipart/form-data">
<fieldset>
	<div class="frow">
		<label class="col4 flabel">类别：</label>
		<div class="col8 last">
			<select class="select" size="1" onchange="showtypes(this)" name="sortid" id="sortid">
  {?section name=i loop=$sortrows?}
  <option value="{?$i['key']?}"{?if $i['key'] == $articlevals['sortid']?} selected="selected"{?/if?}>{?$sortrows[i].caption?}</option>
  {?/section?}
  </select>
  <span id="typeselect" name="typeselect"></span>
  <script type="text/javascript">
  function showtypes(obj){
    var typeselect=document.getElementById('typeselect');
    typeselect.innerHTML='';
    {?section name=i loop=$sortrows?}
	  {?if $sortrows[i].types != ''?}
	  if(obj.options[obj.selectedIndex].value == {?$i['key']?}) typeselect.innerHTML='<select class="select" size="1" name="typeid" id="typeid">{?section name=j loop=$sortrows[i].types?}<option value="{?$j['key']?}"{?if $j['key'] == $articlevals['typeid']?} selected="selected"{?/if?}>{?$sortrows[i]['types'][j]?}</option>{?/section?}</select>';
	  {?/if?}
    {?/section?}
  }
  showtypes(document.getElementById('sortid'));
  </script>
		</div>
	</div>
	
	<div class="frow">
		<label class="col4 flabel">小说名称：</label>
		<div class="col8 last">
			<input type="text" class="text" name="articlename" id="articlename" maxlength="50" value="{?$articlevals['articlename']?}" />
		</div>
	</div>
	
	<div class="frow">
		<label class="col4 flabel">副标题：</label>
		<div class="col8 last">
			<input type="text" class="text" name="backupname" id="backupname" maxlength="100" value="{?$articlevals['backupname']?}" /><br /><span class="hot">一句话简介</span>
		</div>
	</div>
	
	<div class="frow">
		<label class="col4 flabel">标签：</label>
		<div class="col8 last">
			<div class="dropdown" style="width:100%;">
  			<div><input type="text" class="text" name="keywords" id="tagwords" maxlength="100" value="{?$articlevals['keywords']?}"{?if $taglimit > 0?} readonly="readonly"{?/if?} />{?if $tagnum == 0?} <span class="hot">多个标签用英文空格分隔</span>{?/if?}</div>
  			{?if $tagnum > 0?}
  			<div class="dropbox" style="width:400px;padding:5px 10px;">
    		<ul class="ultag">
			{?section name=i loop=$tagwords?}
			<li onclick="selecttag('tagwords', this);"{?if $tagwords[i].use > 0?} class="taguse"{?/if?}>{?$tagwords[i].name?}</li>
			{?/section?}
    		</ul>
  			</div>
  			{?/if?}
 			</div>
		</div>
	</div>
	{?if $allowtrans > 0?}
	<div class="frow">
		<label class="col4 flabel">作者：</label>
		<div class="col8 last">
			<input type="text" class="text" name="author" id="author" maxlength="30" value="{?$articlevals['author']?}" />
		</div>
	</div>
	
	<div class="frow">
		<label class="col4 flabel">作者绑定：</label>
		<div class="col8 last">
			{?section name=i loop=$authorflag['items']?}
  			<label class="radio"><input type="radio" name="authorflag" value="{?$i['key']?}" {?if $i['key'] == $articlevals['authorflag']?}checked="checked" {?/if?}/>{?$authorflag['items'][i]?}</label> 
  			{?/section?}
		</div>
	</div>
	{?/if?}
	<div class="frow">
		<label class="col4 flabel">授权级别：</label>
		<div class="col8 last">
			{?section name=i loop=$permission['items']?}
  			<label class="radio"><input type="radio" name="permission" value="{?$i['key']?}" {?if $i['key'] == $articlevals['permission_n']?}checked="checked" {?/if?}/>{?$permission['items'][i]?}</label> 
  			{?/section?}
		</div>
	</div>
	
	<div class="frow">
		<label class="col4 flabel">首发状态：</label>
		<div class="col8 last">
			{?section name=i loop=$firstflag['items']?}
  			<label class="radio"><input type="radio" name="firstflag" value="{?$i['key']?}" {?if $i['key'] == $articlevals['firstflag_n']?}checked="checked" {?/if?}/>{?$firstflag['items'][i]?}</label> 
  			{?/section?}
		</div>
	</div>
	
	<div class="frow">
		<label class="col4 flabel">写作进度：</label>
		<div class="col8 last">
			{?section name=i loop=$progress['items']?}
  			<label class="radio"><input type="radio" name="progress" value="{?$i['key']?}" {?if $i['key'] == $articlevals['progress_n']?}checked="checked" {?/if?}/>{?$progress['items'][i]?}</label> 
  			{?/section?}
		</div>
	</div>
	
	<div class="frow">
		<div class="row">
		<label class="col4 flabel">内容简介：</label>
		<div class="col8 last">&nbsp;</div>
		</div>
		<div class="row"><textarea class="textarea" name="intro" id="intro" rows="6" >{?$articlevals['intro']?}</textarea></div>
	</div>
	
	<div class="frow">
		<div class="row">
		<label class="col4 flabel">本书公告：</label>
		<div class="col8 last">&nbsp;</div>
		</div>
		<div class="row"><textarea class="textarea" name="notice" id="notice" rows="6">{?$articlevals['notice']?}</textarea></div>
	</div>
	{?if $eachlinknum > 0?}
	<div class="frow">
		<label class="col4 flabel">推荐小说：</label>
		<div class="col8 last">
			<input type="text" class="text" name="eachlinkids" id="eachlinkids" value="{?$articlevals['eachlinkids']?}" /><br /><span class="hot">请填写本站小说ID，最多{?$eachlinknum?}个，用空格分开</span>
		</div>
	</div>
	{?/if?}
	<div class="frow">
		<label class="col4 flabel">封面小图：</label>
		<div class="col8 last">
			<input type="file" class="text" name="articlespic" id="articlespic" /><br /><span class="hot">图片格式：{?$imagetype?}</span>
		</div>
	</div>

	<div class="frow">
		<label class="col4 flabel">封面大图：</label>
		<div class="col8 last">
			<input type="file" class="text" name="articlelpic" id="articlelpic" /><br /><span class="hot">图片格式：{?$imagetype?}</span>
		</div>
	</div>
	{?if $ismanager > 0 || $allowmodify > 0?}
	<div class="frow head tc">管理员修改选项</div>
	{?/if?}
	{?if $ismanager > 0?}
	<div class="frow">
		<label class="col4 flabel">责任编辑：</label>
		<div class="col8 last">
			<input type="text" class="text" name="agent" id="agent" maxlength="30" value="{?$articlevals['agent']?}" /><br /><span class="hot">可以留空或者指定本站会员名称</span>
		</div>
	</div>
	
	<div class="frow">
		<label class="col4 flabel">发表者：</label>
		<div class="col8 last">
			<input type="text" class="text" name="poster" id="poster" maxlength="30" value="{?$articlevals['poster']?}" /><br /><span class="hot">可指定本站会员名称，默认无需修改</span>
		</div>
	</div>
	
	<div class="frow">
		<label class="col4 flabel">是否签约：</label>
		<div class="col8 last">
			{?section name=i loop=$issign['items']?}
  			<label class="radio"><input type="radio" name="issign" value="{?$i['key']?}" {?if $i['key'] == $articlevals['issign_n']?}checked="checked" {?/if?}/>{?$issign['items'][i]?}</label> 
  			{?/section?}
		</div>
	</div>
	{?if $wholebuy > 0?}
	<div class="frow">
		<label class="col4 flabel">整本价格：</label>
		<div class="col8 last">
			<input type="text" class="text" name="saleprice" id="saleprice" maxlength="10" value="{?$articlevals['saleprice']?}" /> {?$egoldname?}<br /><span class="hot">（设为0表示不允许整本订阅，大于0则允许）</span>
		</div>
	</div>
	{?/if?}
	{?if $rgroup['items']|count > 0?}
	<div class="frow">
		<label class="col4 flabel">所属频道：</label>
		<div class="col8 last">
			{?section name=i loop=$rgroup['items']?}
  			<label class="radio"><input type="radio" name="rgroup" value="{?$i['key']?}" {?if $i['key'] == $articlevals['rgroup_n']?}checked="checked" {?/if?}/>{?$rgroup['items'][i]?}</label> 
  			{?/section?}
		</div>
	</div>
	{?/if?}
	{?if $customsites|count > 0?}
	<div class="frow">
		<label class="col4 flabel">来源网站：</label>
		<div class="col8 last">
			<select class="select" size="1" name="siteid">
  			<option value="0"{?if $i['key'] == $articlevals['siteid']?} selected="selected"{?/if?}>本站原创</option>
  			{?section name=i loop=$customsites?}
  			<option value="{?$i['key']?}"{?if $i['key'] == $articlevals['siteid']?} selected="selected"{?/if?}>{?$customsites[i].name?}</option>
  			{?/section?}
  			</select>
		</div>
	</div>
	{?/if?}
	{?/if?}
	<div class="frow">
		<label class="col4 flabel">&nbsp;</label>
		<div class="col8 last">
			<button type="submit" class="button" name="submit">提 交</button>
			<input type="hidden" name="id" value="{?$articlevals['articleid']?}" />
			<input type="hidden" name="act" value="update" />{?$jieqi_token_input?}
		</div>
	</div>
</fieldset>
</form>