{:tpl head}
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>单网页管理</caption>
  <tr>
   <td>
    <strong>管理选项：</strong>
    <a href="?c=onepage&a=add">发布独立单网页</a>|
    <a href="?c=onepage">管理独立单网页</a>|
	<a href="?c=onepage&a=add&block=1">发布区块</a>|
    <a href="?c=onepage&block=1">管理区块</a>|
	<a href="?c=onepage&a=manage">管理分类单网页</a>（<span class="fred">进入内容管理，选择单网页分类，发布分类单网页内容</span>）
   </td>
  </tr>
</table>
<!--{:if $a == 'add' || $a == 'edit'}-->
<form name="myform" action="?c=onepage&a={:$a}" method="post">
<table cellpadding="0" cellspacing="1" class="table_form">
 <caption>{:if $a == 'add'}发布{:else}修改{:/if}{:if $data['block']}区块{:else}独立单网页{:/if}</caption>
 <input type="hidden" name="info[id]" value="{:$data['id']}" />
 <input type="hidden" name="info[block]"  value="{:$data['block']}" />
 <input type="hidden" name="forward" value="{:$referer}" />
 <!--{:if $data['block']}-->
 <tr>
  <td width="140" align="right"><span class="fred">*</span> 名 称：</td>
  <td>
   <input name="info[name]" type="text" value="{:$data['name']}" size="20" require="true" datatype="require" msg="名称不能为空"> 
   区块名称，不可重复，一般是英文（拼音），调用方式 {#:M('onepage') -> block('名称')}</td>
 </tr>
 <tr>
  <td align="right">说 明：</td>
  <td>
   <input name="info[title]" type="text" value="{:$data['title']}" size="40"></td>
 </tr>
 <!--{:else}-->
 <tr>
  <td width="140" align="right"><span class="fred">*</span> 名 称：</td>
  <td>
   <input name="info[name]" type="text" value="{:$data['name']}" size="20" require="true" datatype="require" msg="名称不能为空"> 
   文件保存的名称，不可重复，一般是英文（拼音）</td>
 </tr>
 <tr>
  <td align="right"><span class="fred">*</span> 标 题：</td>
  <td>
   <input name="info[title]" type="text" value="{:$data['title']}" size="40" require="true" datatype="require" msg="标题不能为空"></td>
 </tr>
 <tr>
  <td align="right">Seotitle(标题)：</td>
  <td>
   <input name="info[seotitle]" type="text" value="{:$data['seotitle']}" size="40"></td>
 </tr>
 <tr>
  <td align="right">Meta Keywords(关键字)：</td>
  <td>
   <input name="info[keywords]" type="text" value="{:$data['keywords']}" size="55" />
  </td>
 </tr>
 <tr>
  <td align="right">Meta Description(描述)：</td>
  <td><input name="info[description]" type="text" value="{:$data['description']}" size="60" /></td>
 </tr>
 <tr>
  <td align="right">自定义变量：<br /><span class="fblue">格式：变量名=值&nbsp;<br />可多个，每行一个&nbsp;</span></td>
  <td><textarea name="info[variable]" cols="65" rows="4">{:$data['variable']}</textarea> 
  <span class="fblue">* 调用方式 {#:$变量名}</span></td>
 </tr>
 <!--{:/if}-->
 <tr>
  <td align="right"><span class="fred">*</span> 内 容：</td>
  <td>{:Tag::editor('content', 'info[content]', $data['content'], 'onepage', 450, '100%', 'normal', 'require="true" datatype="require" msg="内容不能为空"')}</td>
 </tr>
 {:if !$data['block']}
 <tr>
  <td align="right">模 板：</td>
  <td>
  <select name="info[tpl]"> 
  {:loop $onepagetpl $v}<option value="{:$v}"{:Tag::selected($data['tpl'],$v)}>{:$v}</option>{:/loop}
  </select>
  </td>
 </tr>
 {:/if}
 <tr>
  <td align="right">选 项：</td>
  <td><input name="saveremote" type="checkbox" value="1">远程上传(内容附件)</td>
 </tr>
 <tr>
  <td colspan="2" height="30" align="center"><button type="submit" value="submit" name="submit">提交</button></td>
 </tr>
</table>
</form>
<script type="text/javascript" src="../../statics/js/validator.js"></script>
<script language="javascript" type="text/javascript">
$(function(){
	$('form').checkForm(1);
})
</script>
<!--{:elseif $a == 'defaults'}-->
<!--{:if $block}-->
<form name="myform" method="post">
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>管理区块</caption>
 <input type="hidden" value='' name="selids" />
 <input type="hidden" value='{:$block}' name="block" />
 <tr align=center>
  <th width="4%"><input name="checkbox" type="checkbox" onclick="checkorno(this,this.form.names)" /></th>
  <th width="20%">名称</th>
  <th>说明</th>
  <th width="20%">管理操作</th>
 </tr>
 {:loop $data $v}
 <tr align="center">
  <td><input name="ids" type="checkbox" value="{:$v['id']}" /></td>
  <td align="left">{:$v['name']}</td>
  <td align="left">{:$v['title']}</td>
  <td><a href="?c=onepage&a=edit&id={:$v['id']}">修改</a>&nbsp;|&nbsp;<a href="?c=onepage&a=del&selids={:$v['id']}">删除</a></td>
 </tr>
 {:/loop}
 <tr>
  <td height="20" colspan="4" 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="submitsc" type="button" onClick="subform(this.form,this.form.ids,'?c=onepage&a=del','确认删除吗？此操作不可恢复。')">删除</button>
  </td>
 </tr>
</table>
</form>
<!--{:else}-->
<form name="myform" method="post">
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>管理独立单网页</caption>
 <input type="hidden" value="" name="selids" />
 <input type="hidden" value="{:$referer}" name="forward" />
 <input type="hidden" value="{:$block}" name="block" />
 <input type="hidden" value="{:ROOT_URL}index.php?c=html&id={:$loginInfo['userid']}&hash={:$loginInfo['hash']}" id="update_html_action" />
 <tr align="center">
  <th width="4%"><input name="checkbox" type="checkbox" onclick="checkorno(this,this.form.names)" /></th>
  <th width="10%">名称</th>
  <th width="15%">标题</th>
  <th width="15%">Seotitle(标题)</th>
  <th width="20%">Meta Keywords(关键字)</th>
  <th>Meta Description(描述)</th>
  <th width="15%">管理操作</th>
 </tr>
 {:loop $data $v}
 <tr>
  <td align="center"><input name="ids" type="checkbox" value="{:$v['id']}" /></td>
  <td>{:$v['name']}</td>
  <td><a href="{:Url::getOnepageUrl($v['id'])}" target="_blank">{:$v['title']}</a></td>
  <td>{:$v['seotitle']}</td>
  <td>{:$v['keywords']}</td>
  <td>{:Tag::cut($v['description'],100)}</td>
  <td align="center"><a href="javascript:;" onclick="update_html('onepage', {:$v['id']})">生成</a>&nbsp;|&nbsp;<a href="?c=onepage&a=edit&id={:$v['id']}">修改</a>&nbsp;|&nbsp;<a href="?c=onepage&a=del&selids={:$v['id']}">删除</a></td>
 </tr>
 {:/loop}
 <tr>
  <td height="20" colspan="7" 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="submitsc" type="button" onClick="subform(this.form,this.form.ids,'?c=onepage&a=del','确认删除吗？此操作不可恢复。')">删除</button>
   <button type="button" onClick="update_html('onepage', '', this.form.ids)">生成HTML</button>
  </td>
 </tr>
</table>
</form>
<!--{:/if}-->
{:if $pages}<div class="pages">{:$pages}</div>{:/if}
<!--{:elseif $a == 'category'}-->
<form name="myform" action="?c=onepage&a=category" method="post" onsubmit="return doCheck(this);">
<table cellpadding="0" cellspacing="1" class="table_form">
 <caption>{:if $data['id']}编辑{:else}发布{:/if}分类单网页</caption>
 <input type="hidden" name="info[id]" value="{:$data['id']}" />
 <input type="hidden" name="catid" value="{:$data['catid']}" />
 <input type="hidden" name="info[name]" value="{:$data['name']}" /> 
 <tr class="fgray">
  <td width="140" align="right">名 称：</td>
  <td>{:$data['name']}&nbsp;&nbsp;<span class="fblue">*文件保存的名称，在栏目管理中设置</span></td>
 </tr>
 <tr class="fgray">
  <td align="right">分 类：</td>
  <td>{:$data['category']}</td>
 </tr>
 <tr>
  <td align="right"><span class="fred">*</span> 标 题：</td>
  <td><input name="info[title]" type="text" value="{:$data['title']}" size="40" require="true" datatype="require" msg="标题不能为空"></td>
 </tr>
 <tr>
  <td align="right">Seotitle(标题)：</td>
  <td>
   <input name="info[seotitle]" type="text" value="{:$data['seotitle']}" size="40"></td>
 </tr>
 <tr>
  <td align="right">Meta Keywords(关键字)：</td>
  <td>
   <input name="info[keywords]" type="text" value="{:$data['keywords']}" size="55" />
  </td>
 </tr>
 <tr>
  <td align="right">Meta Description(描述)：</td>
  <td><input name="info[description]" type="text" value="{:$data['description']}" size="60" /></td>
 </tr>
 <tr>
  <td align="right">自定义变量：<br /><span class="fblue">格式：变量名=值&nbsp;<br />可多个，每行一个&nbsp;</span></td>
  <td><textarea name="info[variable]" cols="65" rows="4">{:$data['variable']}</textarea> 
  <span class="fred">*调用方式 {#:$变量名}</span></td>
 </tr>
 <tr>
  <td align="right"><span class="fred">*</span> 内 容：</td>
  <td>{:Tag::editor('content', 'info[content]', $data['content'], 'onepage', 450, '100%', 'normal', 'require="true" datatype="require" msg="内容不能为空"')}</td>
 </tr>
 <tr>
  <td align="right">模 板：</td>
  <td>
  <select name="info[tpl]"> 
  {:loop $onepagetpl $v}<option value="{:$v}"{:Tag::selected($data['tpl'],$v)}>{:$v}</option>{:/loop}
  </select>
  &nbsp;&nbsp;<input name="saveremote" type="checkbox" value="1">远程上传(内容附件)
  </td>
 </tr>
 <tr>
  <td colspan="2" height="30" align="center"><button type="submit" value="submit" name="submit">提交</button></td>
 </tr>
</table>
</form>
<script type="text/javascript" src="../../statics/js/validator.js"></script>
<script language="javascript" type="text/javascript">
$(function(){
	$('form').checkForm(1);
})
</script>
<!--{:elseif $a == 'manage'}-->
<form name="myform" method="post">
<table cellpadding="0" cellspacing="1" class="table_list">
 <caption>管理分类单网页</caption>
 <input type="hidden" value="" name="selids" />
 <tr align="center">
  <th width="4%"><input name="checkbox" type="checkbox" onclick="checkorno(this,this.form.names)" /></th>
  <th width="10%">名称</th>
  <th width="20%">标题</th>
  <th width="20%">关键字</th>
  <th width="30%">简介</th>
  <th width="20%">管理操作</th>
 </tr>
 {:loop $data $v}
 <tr align="center">
  <td><input name="ids" type="checkbox" value="{:$v['id']}" /></td>
  <td align="left">{:$v['name']}</td>
  <td><a href="{:Url :: getListUrl($v['catid'])}" target="_blank">{:$v['title']}</a></td>
  <td>{:$v['keywords']}</td>
  <td>{:Tag::cut($v['description'],100)}</td>
  <td><a href="?c=onepage&catid={:$v['catid']}">修改</a>&nbsp;|&nbsp;<a href="?c=onepage&a=del&selids={:$v['id']}">删除</a></td>
 </tr>
 {:/loop}
 <tr>
  <td height="20" colspan="8" 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="submitsc" type="button" onClick="subform(this.form,this.form.ids,'?c=onepage&a=del','确认删除吗？此操作不可恢复。')">删除</button>
  </td>
 </tr>
</table>
</form>
{:if $pages}<div class="pages">{:$pages}</div>{:/if}
<!--{:/if}-->
{:tpl foot}