<%@ Page Language="C#" AutoEventWireup="true" Inherits="System_TemplateList_CreateFolder, QianboCMS" EnableEventValidation="false" %>
<%@ Import Namespace="Qianbo.Common" %>
<!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 runat="server">
    <title>创建目录</title>
    <link rel="stylesheet" href="../Css/layout.css" type="text/css" />
    <script type="text/javascript" src="../../Js/jquery.js"></script>
    <script type="text/javascript" src="../../Js/lhgdialog/lhgdialog.min.js?self=true"></script>
    <script type="text/javascript" src="../../Js/Common.js"></script>
    <script type="text/javascript" src="../../Js/SelectFile.js"></script>
    <script language="javascript" type="text/javascript">
        function setx(result) {
            if (result == null) {
                result = "";
            }
            window.location.href = "CreateFolder.aspx" + result;
        }
        function templatePrecompiler(val) {
            var result = System_TemplateList_CreateFolder.TempLatePre(val).value;
            pop_window();
            if (result == "true") {
                $("showInfo").innerText = "编译成功";
            }
            else {
                $("showInfo").innerText = "编译失败";
            }
        }
        document.writeln("<div id='mdiv' style='display: none; height: 600px; width: 600px;'>")
        document.writeln("	<div id='div_01' style='width: 300; height: 150; background: #429eef; position: absolute; display: none;'>");
        document.writeln("		<table border='0' width='100%' height='100%'>");
        document.writeln("			<tr><td colspan='2' align='center' id='showInfo'>模板预编译中…</td></tr>");
        document.writeln("			<tr><td align='center'><button type='button' class='btn' onclick=\"javascript:window.location.href=window.location.href\">确定</button></td></tr>");
        document.writeln("		</table>");
        document.writeln("	</div>");
        document.writeln("</div>");
        function pop_window() {
            $("div_01").style.left = document.body.offsetWidth / 3;
            $("div_01").style.top = document.body.offsetHeight / 2;
            $("div_01").style.width = 300;
            $("div_01").style.height = 150;
            $("divBody").style.display = "none";
            $("div_01").style.display = "";
            $("div_01").style.backgroundColor = "#e1ecee";
            $("div_01").style.border = "solid 2px #ccc";
            $("div_01").style.zIndex = 1000;
            $("mdiv").style.backgroundColor = "#eeeeee";
            $("mdiv").style.display = "";
            $("mdiv").style.zIndex = 999;
            $("mdiv").style.width = document.body.offsetWidth;
            $("mdiv").style.height = document.body.offsetHeight + 192;
        }
    </script>
</head>

<body>
    <form id="form1" runat="server">
        <div id="divBody">
            <table cellspacing="1" cellpadding="0" class="wzdh" align="center">
                <tr>
                    <td class="wzlist">
                        <img src="../Images/Skin/Default/you.gif" align="absmiddle" />
                        您现在的位置：<a href="../SystemInfo.aspx">后台管理</a> &gt;&gt; <a href="CreateFolder.aspx">标签&模板管理</a> &gt;&gt; 列表
					</td>
                </tr>
            </table>
            <table cellspacing="1" cellpadding="0" class="border" align="center">
                <tr>
                    <td class="wzlist"><a href="CreateFolder.aspx">模板管理</a> | <a href="../Label/LabelManager.aspx">标签管理</a> | <a href="../Label/StyleManager.aspx">样式管理</a> | <a href="#" onclick="javascript:window.history.back();">返回</a></td>
                </tr>
            </table>
            <table width="100%" cellpadding="2" border="0" cellspacing="1" class="border" align="center">
                <asp:Repeater ID="repFile" runat="server" OnItemCommand="repFileReName_ItemCommand">
                    <HeaderTemplate>
                        <tr class="title">
                            <td>名称</td>
                            <td width="90px">大小</td>
                            <td width="150px">修改时间</td>
                            <td width="270px">操作</td>
                        </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <script type="text/javascript">
                            var jq = jQuery.noConflict();
                            jQuery(function () {
                                jQuery('#FileRenamed<%#Eval("Size") %>').click(function () {
									jQuery.dialog({
										id: 'txtFileRenamed',
										lock: true,
										title: '文件/文件夹改名',
										content: "url:SetDirectory.aspx?fileName=<%# Function.UrlEncode(Eval("Name").ToString()) %>&DirPath=<%=Function.UrlEncode(DirPath) %>&rePath=<%=Server.UrlEncode(rePath) %>",
										width: 650,
										height: 110
									});
								});
							});
                        </script>
                        <tr value="<%#Eval("Path")%>|<%#Eval("Type")%>" class="tdbg" onmouseover="this.className='tdbgmouseover'" onmouseout="this.className='tdbg'">
                            <a onclick='<%#GetScriptStr(Eval("Path"),Eval("Type"),Eval("Name"))%>'>
                                <td class="mouseStyle" align="left">
									<%#GetFileTypeIco(Eval("Type"))%>
									<asp:Label ID="lblFileName" runat="server" Text='<%#Eval("Name")%>'></asp:Label>
								</td>
                                <td class="mouseStyle;"><%#Eval("Size") %><span style="color: #f00;">byte</span></td>
                                <td align="center" class="mouseStyle"><%#Eval("UpdateTime")%></td>
                            </a>
                            <td><a id="FileRenamed<%#Eval("Size") %>" class="mouseStyle">改名</a> | <asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="return confirm('是否确定删除？')">删除</asp:LinkButton><%#GetFileType(Eval("Type"),Eval("Name")) %></td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
                <tr style="display: none;" class="wzlist">
                    <td colspan="4" align="right"><input id="preAllTemplate" type="button" class="btn" onclick="templatePrecompiler('all')" value="预编译所有模板" /></td>
                </tr>
            </table>
            <table border="0" cellpadding="2" cellspacing="1" class="border" align="center">
                <tr>
                    <td class="wzlist">
						目录名称：<asp:TextBox ID="txtForderName" runat="server" Width="200"></asp:TextBox>
                        <asp:Button ID="btnCreateFolder" runat="server" Text="创建目录" OnClick="btnCreateFolder_Click" CssClass="btn" />
                        <asp:FileUpload ID="fileUploadTemplate" runat="server" CssClass="btn" />
                        <asp:Button ID="btnTemplateUpLoad" runat="server" Text="上传模板" OnClick="btnTemplateUpLoad_Click" CssClass="btn" />
					</td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>