<%@ Page language="c#" AutoEventWireup="false" Inherits="Discuz.ForumPage.Admin.templatesgrid" Codebehind="global_templatesgrid.aspx.cs" %>
<%@ Register TagPrefix="cc1" 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 language="javascript" src="../js/common.js"></script>		
		<script language="javascript" src="../../editor/menu.js"></script>
		<script language="javascript" src="../../editor/common.js"></script>
		<script type="text/javascript">
		    function CreateTemplate(pathname)
		    {
		        if(confirm("全部生成" + pathname + "下所有模板的操作非常耗时，您确认要继续吗？")) 
		            window.location="?createtemplate=" + pathname;
		    }
		</script>
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<script>
showhint(0, '<ul><li>如果您想让模板入库存放, 请点选相应模板前面的复选框,并点击入库按钮 </ul>  <ul><li>如果您想从模板库中出库模板, 请点选相应的模板复选框并点击出库按钮 <li>如果您想从模板库中删除模板,请点选相应的模板复选框并点击删除按钮(列表的第一项是系统初始化模板,系统不允许删除)</ul>');
			</script>
			<div class="Navbutton" style="text-align:left;"> 
			<table>
				<TBODY>
					<tr>
						<td><input title="选中/取消选中 本页所有Case" onclick="CheckAll(this.form)" type="checkbox" name="chkall" id="chkall">全选/取消全选
							<cc1:Button id="IntoDB" runat="server" Text=" 入 库 "></cc1:Button> &nbsp;
							<cc1:Button id="DelRec" runat="server" Text=" 出 库 "  ButtonImgUrl="../images/del.gif"></cc1:Button>&nbsp;
							<cc1:Button id="DelTemplates" runat="server" Text=" 删 除 "  ButtonImgUrl="../images/state1.gif" OnClick="DelTemplates_Click"></cc1:Button></td>
					</tr>
				</TBODY>
			</table>
			</div>
			<cc1:datagrid id="DataGrid1" runat="server" >
				<Columns>
				    <asp:TemplateColumn HeaderText="选择">
						<ItemTemplate>
							<INPUT id="templateid" onclick="javascript:SH_SelectOne(this)" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.templateid").ToString() %>"	name="templateid">
							<input type="hidden" name="temp<%# DataBinder.Eval(Container, "DataItem.templateid").ToString() %>" value="<%# DataBinder.Eval(Container, "DataItem.directory").ToString() %>"
						</ItemTemplate>
					</asp:TemplateColumn>
					<asp:BoundColumn DataField="templateid" HeaderText="ID [递增]" Visible="false" ></asp:BoundColumn>
					<asp:TemplateColumn HeaderText="模板名称">
						<ItemStyle HorizontalAlign="Left" />
						<ItemTemplate>
						    &nbsp;
							<span id="<%# DataBinder.Eval(Container, "DataItem.name").ToString() %>" onmouseover="showMenu(this.id, 0, 0, 1, 0);" style="font-weight:bold">
							<%# DataBinder.Eval(Container, "DataItem.name").ToString() %>&nbsp;<img src="../images/eye.gif" style="vertical-align:middle" />
							</span>
							<div id="<%# DataBinder.Eval(Container, "DataItem.name").ToString() %>_menu" style="display:none">
							<img src="../../templates/<%# DataBinder.Eval(Container, "DataItem.name").ToString() %>/about.png" onerror="this.src='../../images/common/none.gif'" />
							</div>
						</ItemTemplate>
					</asp:TemplateColumn>
					<asp:BoundColumn DataField="directory" HeaderText="存放路径"></asp:BoundColumn>
					<asp:BoundColumn DataField="copyright" HeaderText="版权" ></asp:BoundColumn>
					<asp:BoundColumn DataField="author" HeaderText="作者"></asp:BoundColumn>
					<asp:BoundColumn DataField="createdate"  HeaderText="创建日期" ReadOnly=true></asp:BoundColumn>
					<asp:BoundColumn DataField="ver"  HeaderText="模板版本"></asp:BoundColumn>
					<asp:BoundColumn DataField="fordntver"  HeaderText="适用论坛版本" ReadOnly=true ></asp:BoundColumn>
								
					<asp:TemplateColumn HeaderText="已入库">
						<ItemTemplate>
							<asp:Label id=Label1 runat="server" Text='<%# Valid(DataBinder.Eval(Container, "DataItem.valid").ToString())%>'></asp:Label>
						</ItemTemplate>
					</asp:TemplateColumn>
					
					<asp:TemplateColumn HeaderText="">
						<ItemTemplate>
							<asp:Label id=Label2 runat="server" Text='<%# CreateStr(DataBinder.Eval(Container, "DataItem.name").ToString(),DataBinder.Eval(Container, "DataItem.directory").ToString(),DataBinder.Eval(Container, "DataItem.templateid").ToString())%>'></asp:Label>
						</ItemTemplate>
					</asp:TemplateColumn>
					
				</Columns>
			</cc1:datagrid>
		</form>
		<%=footer%>
	</body>
</HTML>