<!--{template 'pic/head'}-->
<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='+mod+'&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>
<script language=javascript src="{AW_P}images/js/manage.js"></script>
<form method="post" name="myform" id="myform"  onsubmit="return makeSure()">
<input type='hidden' name='updateinfo' value='1'>
<input type='hidden' name='start' value='1'>
<table cellpadding="0" cellspacing="0" class="tableborder" id="mytable" style="width:100%">
	<tr align=center>
		<td width="40" class="tablerowhighlight"></td>
		<td width="60" class="tablerowhighlight">ID<!--{if $ordering == 0}-->
			<img onclick="setLocation('ordering', 1);" style="margin-left:6px;cursor:pointer;" width="7" height="7" border="0" src="{AW_P}images/sma/order_asc.gif" />
		<!--{else}-->
			<img onclick="setLocation('ordering', 0);" style="margin-left:6px;cursor:pointer;" width="7" height="7" border="0" src="{AW_P}images/sma/order_desc.gif" />
		<!--{/if}--></td>
		<td width="50" class="tablerowhighlight">排序</td>
		<td width="600" class="tablerowhighlight">标题</td>
		<td width="8%" class="tablerowhighlight">编辑</td>
		<td width="12%" class="tablerowhighlight">发表时间</td>
		<td width="7%" class="tablerowhighlight">状态</td>
		<td width="140" class="tablerowhighlight">管理操作</td>
	</tr>
	<!--{loop $data $pic}-->
	<tr class="item" id="item-{$pic['id']}">
		<td class="tablerowl"><input name='ids[]' type='checkbox' id='ids_{$pic[id]}' value='{$pic[id]}' onclick="try{event.cancelBubble=true;}catch(e){event.stopPropagation();}"/></td>
		<td class="tablerowl">{$pic[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[{$pic['id']}]" value="{$pic['ordering']}" rel="{$pic['ordering']}" onkeyup="changeOrdering({$pic['id']}, this)" /></td>
		<td align=left>[<a href="system.php?sys=module&mod={$mod}&channelid={$pic['channelid']}&action=manage&status={$status}&cid={$pic[cid]}"><font color="blue">{$pic[title]}</font></a>] <a href="module.php?mod={$mod}&channelid={$channelid}&action=edit&id={$pic[id]}&cid={$pic[cid]}">{$pic[subject]}</a></td>
		<td align="center"><a href="#" target="_blank">{$pic[editor]}</a></td>
		<td align="center">{$pic[dateline]}</td>
		<td align="center" title='{$pic[alt]}'>{$pic[des]}</td>
		<td align="center">
		<!--{if $pic['status'] == 0}-->
			<span id="view_{$pic[id]}"><!--{if $pic[html] == 1}--><a href='{$pic[ym]}' target=_blank><font color=blue>浏览</font></a><!--{/if}--></span> 
			 <a href="module.php?mod=pic&channelid={$channelid}&action=edit&id={$pic[id]}&cid={$pic[cid]}">修改</a>
			 <a onclick="if(makeSure()) edit('delete',0,{$pic[id]});"  href="javascript:void(0);" id="a_delete_{$pic[id]}">删除</a>
		<!--{elseif $pic['status'] == 4}-->
			<a href="{$pic['ym']}" target=_blank><font color=blue>预览</font></a>
			<a onclick="edit('go_back',1,{$pic[id]});"  href="javascript:void(0);" id="a_go_back_{$pic[id]}">待审</a>
			<a onclick="if(makeSure()) edit('delete',1,{$pic[id]});"  href="javascript:void(0);" id="a_delete_{$pic[id]}">彻底删除</a>
		<!--{else}-->
			<a href="{$pic['ym']}" target=_blank><font color=blue>预览</font></a>
			<a href="module.php?mod=pic&channelid={$channelid}&action=edit&id={$pic[id]}&cid={$pic[cid]}">修改</a>
			<a onclick="edit('del',1,{$pic[id]});"  href="###" id="a_delete_{$pic[id]}">彻底删除</a>
		<!--{/if}-->
		</td>
	</tr>
	<!--{/loop}-->
	<tr>
		<td align=center class="tablerow">
			<input name='chkall' type='checkbox' id='chkall' onclick='checkall(this.form)' value='checkbox' />
		</td>
		<td colspan=7 class="tablerow manage_act">
			<!--{if $status == 4}-->
				<script type="text/javascript">
				rm.AddItem("成为待审","if(makeSure()) edit('go_back',1,rm.id);rm.Close();");
				rm.AddItem("彻底删除","if(makeSure()) edit('delete',1,rm.id);rm.Close();");
				</script>
				<input class="f-button"  type='button' value='彻底删除{$channeltitle}' onClick="if(!makeSure()) return false;document.myform.action='module.php?mod=pic&channelid={$channelid}&action=update&action_do=delete&last=1&recycle=1';this.disabled=true;document.forms['myform'].submit();">
				<input  class="f-button" type='button' value='成为待审' onClick="if(!makeSure()) return false;document.myform.action='module.php?mod=pic&channelid={$channelid}&action_do=go_back&action=update&recycle=1';this.disabled=true;document.forms['myform'].submit();">
			<!--{else}-->
					<script type="text/javascript">
						rm.AddItem("移到回收站","if(makeSure()) edit('delete',0,rm.id);rm.Close();");
						rm.AddItem("彻底删除","if(makeSure()) edit('delete',1,rm.id);rm.Close();");
					</script>
		        <!--{if $status > 0 }-->
					<input name='submit6' type='button'  class="f-button" value='通过审核' onClick="if(!makeSure()) return false;document.myform.action='module.php?mod=pic&channelid={$channelid}&action=update&action_do=is_pass';this.disabled=true;document.forms['myform'].submit();">
				<!--{else}-->
					<script type="text/javascript">
						rm.AddItem("预览当前内容","preview(rm.id);rm.Close();");
					</script>
					<input  class="f-button" type='button' value='删除{$channeltitle}' onClick="if(!makeSure()) return false;document.myform.action='module.php?mod=pic&channelid={$channelid}&action=update&action_do=delete';this.disabled=true;document.forms['myform'].submit();">
					<input class="f-button"  id="toHTML" type='button' value='生成{$channeltitle}' onClick="htmlCreateGoReady();">
					<input class="f-button"  type='button' value='移动到>>' onClick="if(!makeSure()) return false;document.myform.action='module.php?mod=pic&channelid={$channelid}&action=update&action_do=move';this.disabled=true;document.forms['myform'].submit();">
					<select name='cid'>
						{$strall}
					</select>
				<!--{/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 cellpadding="0" cellspacing="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>
	<!--{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'}-->
