<%@ Page Language="C#" AutoEventWireup="true" Inherits="PowerEasy.Module.General.WebSite.Admin.Accessories.ShowTemplates"
    CodeBehind="ShowTemplates.aspx.cs" %>

<!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>
</head>
<body class="tdbg">
    <form id="form1" runat="server">
    <span style="color: Blue">注：单击文件夹进入模板列表，单击模板选中，双击模板选中并关闭窗口。</span>
    <div style="width: 100%; height: 100%;">
        <asp:Repeater ID="RepFiles" runat="server" OnItemDataBound="RepFiles_ItemDataBound">
            <ItemTemplate>
                <%#  System.Convert.ToInt32(Eval("type")) == 1 ? "<img src=\"../../Admin/Images/Node/closefolder.gif\" style=border-right: 0px; border-top: 0px;border-left: 0px; border-bottom: 0px />" : "<img src=\"../../Admin/Images/Node/singlepage.gif\" style=border-right: 0px; border-top: 0px;border-left: 0px; border-bottom: 0px />"%>
                <span style="cursor: pointer;" onclick="<%#  System.Convert.ToInt32(Eval("type")) == 1 ?"openfilesdir('" + Eval("Name") + "')":"add('" + Eval("Name") + "')"%>"
                    ondblclick="<%#  System.Convert.ToInt32(Eval("type")) == 1 ?"openfilesdir('" + Eval("Name") + "')":"dbadd('" + Eval("Name") + "')"%>">
                    <%# Eval("Name")%>
                </span>
                <br />
            </ItemTemplate>
        </asp:Repeater>
        <asp:HiddenField ID="HdnFileText" runat="server" />
    </div>

    <script language="javascript" type="text/javascript">
    function add(obj)
    {
        if(obj==""){return false;}
        parent.document.getElementById('FileName').value = document.getElementById('HdnFileText').value + "/" + obj;
    }
    
    function dbadd(obj)
    {
    if(obj==""){return false;}
     parent.document.getElementById('FileName').value = document.getElementById('HdnFileText').value + "/" + obj;
    parent.add();
    }
    
    function openfilesdir(obj)
    {
        if(obj==""){return false;}
        var pathtext="<%= Server.UrlEncode(Request.QueryString["FilesDir"]) %>";//如果是

        parent.document.getElementById('ParentDirText').value = pathtext;
        var path="ShowTemplates.aspx?FilesDir="+pathtext+"/"+escape(obj);
        parent.document.getElementById('template_main_right').src=path;
    }
    </script>

    </form>
</body>
</html>
