<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="content_list.aspx.cs" Inherits="JumboUCMS.WebFile.User._content_list" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html   xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta   http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta   http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title></title>
<script type="text/javascript" src="../_libs/jquery.tools.pack.js"></script>
<script type="text/javascript" src="../_data/jcmsU1.js"></script>
<link   type="text/css" rel="stylesheet" href="../_data/jcmsU1.css" />
<script type="text/javascript" src="../style/user/common.js"></script>
<link   type="text/css" rel="stylesheet" href="../style/user/common.css" />
<script type="text/javascript">
var ccid = joinValue('ccid');//频道ID
var cid = joinValue('cid');//栏目ID
var k=joinValue('k');//关键字
var f=joinValue('f');//检索字段
var s=joinValue('s');//检索状态
var d=joinValue('d');//检索时间
var pagesize=15;
var page=thispage();
$(document).ready(function(){
	ajaxList(page);
});
function ajaxList(currentpage)
{
	if(currentpage!=null) page=currentpage;
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"page="+currentpage+"&pagesize="+pagesize+"&time="+(new Date().getTime()),
		url:		"content_ajax.aspx?oper=ajaxGetList"+ccid+cid+k+f+s+d,
        error:		function(XmlHttpRequest,textStatus, errorThrown){if(XmlHttpRequest.responseText!=""){alert(XmlHttpRequest.responseText);}},
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				JumboUCMS.Alert(d.returnval, "0", "top.window.location='../passport/login.aspx';");
				break;
			case '0':
				JumboUCMS.Alert(d.returnval, "0");
				break;
			case '1':
				$("#ajaxList").setTemplateElement("tplList", null, {filter_data: true});
				$("#ajaxList").processTemplate(d);
				$("#ajaxPageBar").html(d.pagerbar);
				break;
			}
		}
	});
}
function operater(act,classid){
	var ids = JoinSelect("selectID");
	if(ids=="")
	{
		JumboUCMS.Alert("请先勾选要操作的内容", "0"); 
		return;
	}
	JumboUCMS.Loading.show("正在处理...");
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"ids="+ids+"&tocid="+classid,
		url:		"content_ajax.aspx?oper=ajaxBatchOper&act="+act+"&time="+(new Date().getTime()) + ccid,
		error:		function(XmlHttpRequest,textStatus, errorThrown){JumboUCMS.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				JumboUCMS.Loading.hide();
				JumboUCMS.Alert(d.returnval, "0", "top.window.location='../passport/login.aspx';");
				break;
			case '0':
				JumboUCMS.Alert(d.returnval, "0");
				break;
			case '1':
				JumboUCMS.Loading.hide();
				ajaxList(page);
				break;
			}
		}
	});
}
function ConfirmDel(id){
	JumboUCMS.Confirm("确定要删除吗？", "ajaxDel("+id+")");
}
function ajaxDel(id){
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"id="+id,
		url:		"content_ajax.aspx?oper=ajaxDel&time="+(new Date().getTime()) + ccid,
		error:		function(XmlHttpRequest,textStatus, errorThrown){JumboUCMS.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				JumboUCMS.Alert(d.returnval, "0", "top.window.location='../passport/login.aspx';");
				break;
			case '0':
				JumboUCMS.Alert(d.returnval, "0");
				break;
			case '1':
				ajaxList(page);
				break;
			}
		}
	});
}
function ajaxSearch(){
	JumboUCMS.Popup.show('content_searchform.aspx?oper=0'+ccid+cid+k+f+s+d,500,280,false);
}
    </script>
</head>
<body>
<div class="topnav"> <span class="preload1"></span><span class="preload2"></span>
	<ul id="topnavbar">
		<li class="topmenu"><a href="javascript:void(0);" class="top_link"><span class="down">添加内容</span></a>
			<ul class="sub">
				<li><a href="javascript:void(0);" onclick="top.JumboUCMS.Popup.show('../modules/article_user_edit.aspx?id=0'+ccid,-1,-1,true)">文章模块</a></li>
				<li><a href="javascript:void(0);" onclick="top.JumboUCMS.Popup.show('../modules/photo_user_edit.aspx?id=0'+ccid,-1,-1,true)">图片模块</a></li>
				<li><a href="javascript:void(0);" onclick="top.JumboUCMS.Popup.show('../modules/video_user_edit.aspx?id=0'+ccid,-1,-1,true)">视频模块</a></li>
				<li><a href="javascript:void(0);" onclick="top.JumboUCMS.Popup.show('../modules/document_user_edit.aspx?id=0'+ccid,-1,-1,true)">文档模块</a></li>
			</ul>
		</li>
		<li class="topmenu"><a href="javascript:void(0);" onclick="ajaxSearch();" id="opersearch" class="top_link"><span>过滤检索</span></a></li>
	</ul>
	<script>
	topnavbarStuHover();
    </script>
</div>
<textarea id="tplList" style="display:none"><table class="listtable" cellspacing="0" cellpadding="0" border="0" style="width:100%;border-collapse:collapse;">
	<tr>
		<th align="center" scope="col" style="width:30px;"><input onclick="checkAll()" id="checkedAll" name="checkedAll" type="checkbox" /></th>
		<th scope="col" style="width:60px;">ID</th>
		<th scope="col" width="*">标题</th>
		<th scope="col" style="width:120px;">所属栏目</th>
		<th scope="col" style="width:100px;">状态</th>
		<th scope="col" style="width:70px;">操作</th>
	</tr>
	{#foreach $T.table as record}
	<tr onmouseover="this.style.backgroundColor='F3F7FF'" onmouseout="this.style.backgroundColor='FFFFFF'">
		<td align="center"><input class="checkbox" name="selectID" type="checkbox" value='{$T.record.id}' />
		</td>
		<td align="center">{$T.record.id}</td>
		<td align="left">&nbsp;&nbsp;&nbsp;<a>{$T.record.title}</a></td>
		<td align="center">{$T.record.classname}</td>
		<td align="center"><img title="{formatIsPass($T.record.ispass)}" src="../admin/images/ico_ispass{$T.record.ispass}.gif" border="0" /><img title="{formatIsImg($T.record.isimg)}" src="../admin/images/ico_isimg{$T.record.isimg}.gif" border="0" /><img title="{formatIsTop($T.record.istop)}" src="../admin/images/ico_istop{$T.record.istop}.gif" border="0" /><img title="{formatIsFocus($T.record.isfocus)}" src="../admin/images/ico_isfocus{$T.record.isfocus}.gif" border="0" /></td>
		<td align="center">
			<a href="javascript:void(0);" onclick="JumboUCMS.Popup.show('../module/{$T.record.module}_user_edit.aspx?id={$T.record.id}'+ ccid,-1,-1,true)">修改</a>
			<a href="javascript:void(0);" onclick="ConfirmDel({$T.record.id})">删除</a>
		</td>
	</tr>
	{#/for}
</table></textarea>
<div id="ajaxList"> </div>
<div id="ajaxPageBar" class="pages"> </div>
</body>
</html>
