<!--{template 'download/head'}-->
<script language=javascript src="{AW_P}images/js/manage.js"></script>
<script type="text/javascript">
	function wl( url){if( url){ window.location=url;};}
	var rm = new qmeCms.rightMenu('mytable');
	rm.AddItem("添加"+channeltitle,"wl('module.php?mod='+mod+'&channelid='+channelid+'&action=add')");
	rm.AddItem("快速修改","setFilter(channelid,rm.id);");
	rm.AddItem("修改"+channeltitle,"wl('module.php?mod=download&channelid='+channelid+'&action=edit&id='+rm.id)");
	rm.AddItem("查看评论","qmeCms.dialogView.iframe('评论','system.php?sys=comment&channelid='+channelid+'&api=1&id='+rm.id,{width:800,type:'abs'});rm.Close();");
	rm.AddItem("查看下载数据","qmeCms.dialogView.get('数据','module.php?mod='+mod+'&action=extra&channelid='+channelid+'&id='+rm.id,{width:640,type:'abs'});rm.Close();");
	rm.AddLine();
</script>
  	<form method="post" name="myform" action="module.php?mod=download&channelid={$channelid}&action=update_all" onsubmit="return makeSure()">
      <input type="hidden" name="actions" value="updateinfo" />
      <!--{if $recycle==1}-->
      <input type="hidden" name="is_last" value="1" />
      <!--{/if}-->
      <input type="hidden" name="action" value="{$action}" />
      <input type="hidden" name="pageno" value="{$pageno}" />
      <input type="hidden" name="pagesize" value="{$pagesize}" />
        <table width="100%" align="center" cellspacing="0" cellpadding="0" class="tableborder" id=mytable>
          <tr>
            <td class="tablerowhighlight" width="30" align="center"></td>
			<!--{if $ordering == 0}-->
			<td class="tablerowhighlight" width="60" align="center" onclick="setLocation('ordering', 1);" style="cursor:pointer;">ID<img style="margin-left:6px;" width="7" height="7" border="0" src="{AW_P}images/sma/order_asc.gif" /></td>
			<!--{else}-->
			<td class="tablerowhighlight" width="60" align="center" onclick="setLocation('ordering', 0);" style="cursor:pointer;">ID<img style="margin-left:6px;" width="7" height="7" border="0" src="{AW_P}images/sma/order_desc.gif" /></td>
			<!--{/if}-->
			<td width="50" class="tablerowhighlight">排序</td>
            <td class="tablerowhighlight" align="center">软件名称</td>
            <td class="tablerowhighlight" width="80" align="center">编辑</td>
            <td class="tablerowhighlight" width="80" align="center">发布时间</td>
            <td class="tablerowhighlight" width="50" align="center">状态</td>
            <td class="tablerowhighlight" width="150" align="center">管理选项</td>
          </tr>	
          <!--{loop $data $download}-->
          <tr class="item" height="24" id="item-{$download[id]}">
            <td align="center" class="tablerowl"><input type="checkbox" name="removes[]" id="ids_{$download[id]}"  value="{$download[id]}" onclick="try{event.cancelBubble=true;}catch(e){event.stopPropagation();}"></td>
			<td align="center" class="tablerowl">{$download[id]}</td>
			<td class="tablerow" align='center'><input type="text" class="f-text" style="text-align:center;width:46px;height:18px;" maxlength="5" name="ordering[{$download['id']}]" value="{$download['ordering']}" rel="{$download['ordering']}" onkeyup="changeOrdering({$download['id']}, this)" /></td>
            <td>
				<table width="100%" align="center" cellspacing="0" cellpadding="0">
					<tr>
						<td>[<a href="system.php?sys=module&mod=download&channelid={$download['channelid']}&action=manage&status={$status}&cid={$download[cid]}"><font color="blue">{$download[title]}</font></a>] <a href="module.php?mod=download&channelid={$channelid}&action=edit&id={$download[id]}&cid={$download[cid]}">{$download[subject]}</a></td>
						<td width=18 valign=middle><!--{if $download[thumb]}--><a href="javascript:picEdit('{$download[thumb]}','{$_SET[webpath]}', config.channelid);"><img border=0 src="images/viewpic.gif" width="18" height="18"></a><!--{/if}--></td>
					</tr>
				</table>
			</td>
            <td align=center>{$download[editor]}</td>
            <td align=center>{$download[dateline]}</td>
			<td title='{$download[alt]}' align=center>{$download[des]}</td>
            <td align="center"> 
			<!--{if $download['status'] == 0}-->
				<span id="view_{$download[id]}"><!--{if $download['html']>0}--><a href='{$download[ym]}' target=_blank><font color=blue>浏览</font></a><!--{/if}--></span> 
				<a href="module.php?mod=download&channelid={$channelid}&action=edit&id={$download[id]}&cid={$download[cid]}">编辑</a> 
				<a onclick="if(makeSure()) edit('delete',0,{$download[id]});" id=a_delete_{$download[id]} href="javascript:void(0);">删除</a> 
			<!--{elseif $download['status'] == 4}-->
				<a onclick="edit('go_back',1,{$download[id]});"  href="###" id="a_go_back_{$download[id]}">待审</a> 
				<a href="{$download['ym']}" target=_blank><font color=blue>预览</font></a>
				<a onclick="if(makeSure()) edit('delete',1,{$download[id]});" id=a_delete_{$download[id]} href="javascript:void(0);">彻底删除</a> 
			<!--{else}-->
				<a href="{$download['ym']}" target=_blank><font color=blue>预览</font></a>
				<a href="module.php?mod=download&channelid={$channelid}&action=edit&id={$download[id]}&cid={$download[cid]}">修改</a>
				<a onclick="edit('del',1,{$download[id]});"  href="###" id="a_delete_{$download[id]}">彻底删除</a>
			<!--{/if}-->
			<!--{if $download['error'] > 0}-->
				<a onclick="edit('error',0,{$download[id]});" id=a_error_{$download[id]} href="javascript:void(0);"><font color=red>取消错误</font></a> 
			<!--{/if}-->
	     </td>
          </tr>
          <!--{/loop}-->
	<tr>
		<td class="tablerow" align=center>
			<input name='chkall' type='checkbox' id='chkall' onclick='checkall(this.form)' value='checkbox'>
		</td>
            <td align="left" class="tablerow manage_act" colspan=7>
              <!--{if $status == 4}-->
              	<input  class="f-button" name='goback' type='submit' value='成为待审' />
              	<input  class="f-button" name='delete' type="submit" value="彻底删除{$channeltitle}" />
				<script type="text/javascript">
					rm.AddItem("彻底删除","if(makeSure()) edit('delete',1,rm.id);rm.Close();");
					rm.AddItem("还原","if(makeSure()) edit('go_back',1,rm.id);rm.Close();");
				</script>
              <!--{else}-->
				<script type="text/javascript">
					rm.AddItem("彻底删除","if(makeSure()) edit('delete',1,rm.id);rm.Close();");
					rm.AddItem("移到回收站","if(makeSure()) edit('delete',0,rm.id);rm.Close();");
				</script>
              		<!--{if $status==0}-->
						<script type="text/javascript">
							rm.AddItem("预览当前内容","preview(rm.id);rm.Close();");
						</script>
              			<input  class="f-button" name='createhtml' id='toHTML' type='button' value='生成HTML' onclick="htmlCreateGoReady();">
              			<input  class="f-button" name='delete' type='submit' value='删除{$channeltitle}'>
						<input class="f-button" type="button" value="导出内容" onclick="exportDataToExecl();" />
						<input class="f-button" name='move' type='submit' value='移动到>>'>
						<select name='tocid'>
							{$strall}
						</select>
					<!--{else}-->
						<input  class="f-button" name='delete' type="submit" value="彻底删除{$channeltitle}">
						<input class="f-button" name='submit6' class="f-button" type='submit' value='通过审核' onClick="document.myform.action='module.php?mod=download&channelid={$channelid}&action=updateinfo&actions=status&status=0';this.disabled=true;">
              		<!--{/if}-->
              <!--{/if}-->
			  <span>每页显示数据：</span><input type=text class="f-text"  value='{$pagesize}' size=5 onchange="myCookie.set('_ps', this.value.toString());window.location='system.php?sys=module&mod={$mod}&channelid={$channelid}&action={$action}&status={$status}&cid={$cid}&pagesize='+this.value">
	</td>
          </tr>
	</table>
	</form>
	<form method=GET name=form action='system.php'>
		<table width="100%" align="center" cellspacing="1" cellpadding="1" class="tableborder">
			<tr>
				<td class="tablerow">	
					<!--{template 'manage_search'}-->
				</td>
			</tr>
			<tr>
				<td class="tablerow"> 
					<!--{eval new pager($total,$pagesize);}-->
				</td>
			</tr>
		</table>
	</form>
<script language=javascript>
	selectChecked( 'type', '{$type}');
</script>
	<!--{if $admin_info[groupid] > 2 && !in_array($channelid, $manage_channel)}-->
	<script type="text/javascript">
		function disabledSubmit(){
			var obj = document.getElementsByTagName("INPUT");
			for( var i=0; i<obj.length; i++){
				if( obj[i].type == 'submit' && obj[i].name != 'Submit'){
					obj[i].disabled = true ;
				}
			}
		}
		disabledSubmit();
	</script>
	<!--{/if}-->

<script type="text/javascript">
	rm.AddLine();
	rm.AddItem("预览频道首页","previewUrl(config.url + 'index.php?mod={$channelid}&ac=index&preview=1')");
	rm.AddItem("频道HTML生成管理","wl('system.php?sys=tohtml&channelid='+channelid+'&channelselect='+channelselect+'&action=tohtml')");
	domReady(function(){
		rm.Setup();
	});
</script>
<!--{template 'foot'}-->