<%@Page Language="C#" Inherits="IWMS.Admin.Class" MasterPageFile="admin.master"%>
<asp:Content ContentPlaceHolderId="cphHead" runat="server">
	<script type="text/javascript" src="inc/admin_class.js"></script>
	<style type="text/css">
		.batch {width:100%;height:400px;overflow-y:scroll;}
		.batch ul {margin:0;margin-left:20px}
		.batch ul li {list-style:none;padding:2px;}
		#prop {background:#eee;padding:3px}
	
		ul.sortable li {position: relative}
		ul.dragUl {padding:4px;font-size: 13px;margin: 1px;width: 15em;font-family: arial, sans-serif; list-style-type:none}
		ul.dragUl li {padding:2px;border:1px solid #ccc;margin-bottom: 4px;cursor: move; background-color:#f3f3f3}
	</style>
</asp:Content>
<asp:Content ContentPlaceHolderId="cphMain" runat="server">
	
	<div class="mframe">
	<div class="tabs">
		<a href="?" class="<%=Request.QueryString["act"]==null ? "tab_on" : "tab_off"%>">修改/删除内容分类</a>
		<a href="?act=ord" class="<%=Request.QueryString["act"]=="ord" ? "tab_on" : "tab_off"%>">设置分类顺序</a>
		<a href="?act=batch" class="<%=Request.QueryString["act"]=="batch" ? "tab_on" : "tab_off"%>">批量设置分类属性</a>
	</div>
	<div class="wrapper">
	<div class="ml"></div>
	<div class="mr"></div>
	<div class="mm">
	<form id="myForm" runat="server">
		<ASP:DataGrid id="MyDataGrid" runat="server"
				Width="100%"
				align="center"
				ShowHeader="true"
				ShowFooter="false"
				AllowPaging="true"
				AutoGenerateColumns="false"
				DataKeyField="classid"
				OnPageIndexChanged="MyDataGrid_Page"
				CssClass="grid"
				BorderColor="#cccccc"
				HeaderStyle-CssClass="gridHead"
				ItemStyle-CssClass="tdbg"
				PageSize="20"
				CellPadding="6"
				CellSpacing="0"
				>
			<EditItemStyle CssClass="tdbg-dark" />
			
			<Columns>
				<asp:BoundColumn
					HeaderText="ID"
					DataField="classid"
					ReadOnly="true" >
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="40"/>
				</asp:BoundColumn>
				<asp:TemplateColumn
					HeaderText="分类名"
					>
					<ItemTemplate>
					<%#GetTitle((System.Data.DataRowView)Container.DataItem)%>
					</ItemTemplate>
				</asp:TemplateColumn>
				<asp:BoundColumn
					HeaderText="新闻数"
					DataField="articleNum"
					ReadOnly="true" >
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="70"/>
				</asp:BoundColumn>
				<asp:BoundColumn
					HeaderText="图片新闻数"
					DataField="imgnewsNum"
					ReadOnly="true" >
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="70"/>
				</asp:BoundColumn>
				<asp:TemplateColumn>
					<ItemTemplate>
					<%#(int)Eval("child")==0 ? "<a href='###' onclick='ajDelete(this,"+Eval("classid")+")'>删除</a>" : ""%>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center"/>
					<HeaderStyle Width="40"/>
				</asp:TemplateColumn>
					
			</Columns>
		</ASP:DataGrid><br/>
		&nbsp;<img src="pic/admin_lock.gif" alt=""/>为限制会员阅读分类
	</form>
	
	<%if (Request.QueryString["act"]=="batch"){%>
		<div id="prop">
			<input type="radio" name="prop" value="canAdd" onclick="ajProp(this)"/>可添加内容
			<input type="radio" name="prop" value="cInBar" onclick="ajProp(this)" checked="checked"/>显示在顶部菜单
			<input type="radio" name="prop" value="cInNav" onclick="ajProp(this)"/>显示在底部导航
			<input type="radio" name="prop" value="inLeft" onclick="ajProp(this)"/>显示在分类左侧导航
			<input type="radio" name="prop" value="newWin" onclick="ajProp(this)"/>新窗口打开内容
		</div>
	<%}%>
	
		<asp:Literal id="mainLiteral" EnableViewState="false" runat="server"/>
		
		<br/>
		<div style="padding:10px">
	<%if(Request.QueryString["act"]=="ord"){%>
		<button onclick="javascript:ajOrder(this)">保存</button>　（拖动分类调整顺序）
	<%}else if (Request.QueryString["act"]=="batch"){%>
		<button onclick="javascript:ajBatch(this)">保存</button>
	<%}%>
		</div>
	</div>
	</div>
	<div class="bl"></div>
	<div class="br"></div>
	<div class="bm"></div>
	</div>

</asp:Content>