<%@ Page language="c#" Inherits="Discuz.ForumPage.Admin.topicsgrid" Codebehind="forum_topicsgrid.aspx.cs" %>
<%@ Register TagPrefix="cc1" Namespace="Discuz.Control" Assembly="Discuz.Control" %>
<%@ Register TagPrefix="cc2" Namespace="Discuz.Control" Assembly="Discuz.Control" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>主题列表</title>
		<LINK href="../styles/datagrid.css" type="text/css" rel="stylesheet">		
		<link href="../styles/dntmanager.css" type="text/css" rel="stylesheet">  
		<script>
function check(browser)
{ 
   document.forms[0].operation.value=browser;
}

function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name == 'tid')
       e.checked = form.chkall.checked;
    }
}

function SH_SelectOne(obj)
{
	//var obj = window.event.srcElement;
	if( obj.checked == false)
	{
		document.getElementById('chkall').checked = obj.chcked;
		
	}
}

		</script>

</head>

	<body>
		<form id="Form1" method="post" runat="server">
			<div class="ManagerForm">
            <fieldset>
		    <legend style="background:url(../images/icons/legendimg.jpg) no-repeat 6px 50%;">操作主题</legend>
				<table class="table1" cellspacing="0" cellpadding="4" width="100%" align="center">					
					<tr>
						<td class="td2"><input type="radio" name="operation" value="moveforum" onClick="check(this.value)" checked>
							批量移动到论坛</td>
						<td class="td2" colspan="2"><cc2:dropdowntreelist id="forumid" runat="server"></cc2:dropdowntreelist></td>
					</tr>
				
					<tr>
						<td class="td1" width="20%"><input type="radio" name="operation" value="delete" onClick="check(this.value)">批量删除</td>
						<td class="td1" width="30%"><input type="checkbox" name="nodeletepostnum" value="1" checked id="nodeletepostnum" runat="server">删帖不减用户发帖数和积分</td>
						<td class="td2" width="20%"><input type="radio" name="operation" value="deleteattach" onClick="check(this.value)">删除主题中的附件</td>
						<td class="td2" width="30%">&nbsp;</td>
					</tr>
					<tr>
						<td class="td2"><input type="radio" name="operation" value="displayorder" onClick="check(this.value)">批量置顶</td>
						<td class="td2">
							<input type="radio" name="displayorder_level" value="0" checked onClick="check(this.value)">取消置顶 <br />
							<input type="radio" name="displayorder_level" value="1" onClick="check(this.value)">
							<img src="../images/star.gif" width="16" height="16"> <br /> 
							<input type="radio" name="displayorder_level" value="2" onClick="check(this.value)">
							<IMG src="../images/star.gif" width="16" height="16"><IMG src="../images/star.gif" width="16" height="16"><br />
							<input type="radio" name="displayorder_level" value="3" onClick="check(this.value)">
							<IMG src="../images/star.gif" width="16" height="16"><IMG src="../images/star.gif" width="16" height="16"><IMG src="../images/star.gif" width="16" height="16">
						</td>
						<td class="td1"><input type="radio" name="operation" value="adddigest" onClick="check(this.value)">批量设置精华</td>
						<td class="td1">
							<input type="radio" name="digest_level" value="0" checked> 取消精华 <br />
							<input type="radio" name="digest_level" value="1">
							<IMG src="../images/star.gif" width="16" height="16"><br />
							<input type="radio" name="digest_level" value="2">
							<IMG src="../images/star.gif" width="16" height="16"><IMG src="../images/star.gif" width="16" height="16"><br />
							<input type="radio" name="digest_level" value="3"> 
							<IMG src="../images/star.gif" width="16" height="16"><IMG src="../images/star.gif" width="16" height="16"><IMG src="../images/star.gif" width="16" height="16">
						</td>
					</tr>
				</table>
				</fieldset>
				<div class="Navbutton"><cc1:Button id="SetTopicInfo" runat="server" Text=" 提 交 "></cc1:Button></div>
				</div>
				&nbsp;&nbsp;<input title="选中/取消选中 本页所有Case" onClick="CheckAll(this.form)" type="checkbox" name="chkall" id="chkall">全选/取消全选
				
			<cc1:datagrid id="DataGrid1" runat="server" OnPageIndexChanged="DataGrid_PageIndexChanged" OnSortCommand="Sort_Grid">
				<Columns>
				    <asp:TemplateColumn HeaderText="选择">
						<ItemTemplate>
							<INPUT id="tid" onclick="javascript:SH_SelectOne(this)" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.tid").ToString() %>"	name="tid">
						</ItemTemplate>
					</asp:TemplateColumn>
					<asp:BoundColumn DataField="tid" SortExpression="tid" HeaderText="帖子ID" Visible="false" ></asp:BoundColumn>
					<asp:TemplateColumn HeaderText="标题">
					    <ItemTemplate>
					    <a href="../../showtopic.aspx?topicid=<%# DataBinder.Eval(Container, "DataItem.tid").ToString() %>" target="_blank"><%# DataBinder.Eval(Container, "DataItem.title").ToString() %></a>
					    </ItemTemplate>
					</asp:TemplateColumn>
					<asp:BoundColumn DataField="poster" SortExpression="poster" HeaderText="发帖人"></asp:BoundColumn>
					<asp:BoundColumn DataField="postdatetime" SortExpression="postdatetime" HeaderText="发布日期" ></asp:BoundColumn>
					<asp:BoundColumn DataField="lastposter" SortExpression="lastposter" HeaderText="最后回复人"></asp:BoundColumn>
					
					<asp:TemplateColumn HeaderText="回帖数">
						<ItemTemplate>
				 			<%# GetPostLink(DataBinder.Eval(Container, "DataItem.tid").ToString(),DataBinder.Eval(Container, "DataItem.replies").ToString())%>
						</ItemTemplate>
					</asp:TemplateColumn>
					
					<asp:BoundColumn DataField="views" SortExpression="views" HeaderText="查看数"></asp:BoundColumn>
					<asp:BoundColumn DataField="digest" SortExpression="digest" HeaderText="精华帖" ></asp:BoundColumn>
					<asp:BoundColumn DataField="displayorder" SortExpression="displayorder" HeaderText="显示顺序"></asp:BoundColumn>
					<asp:BoundColumn DataField="price" SortExpression="price" HeaderText="价格"></asp:BoundColumn>
					
					<asp:TemplateColumn HeaderText="关闭">
						<ItemTemplate>
			    			<%# BoolStr(DataBinder.Eval(Container, "DataItem.closed").ToString())%>
						</ItemTemplate>
					</asp:TemplateColumn>
					
										
				</Columns>
			</cc1:datagrid>
				<div id="topictypes" style="display:none;width:100%;">
					<tr>
						<td class="td2"><input type="radio" name="operation" value="movetype" onClick="check(this.value)">
							批量移动到分类</td>
						<td class="td2"><cc2:dropdownlist id="typeid" runat="server"></cc2:dropdownlist></td>
					</tr>
					</div>
		</form>
			<%=footer%>
	</body>
</HTML>
