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

<!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 id="Head1" runat="server">
    <title>上传文件选择页</title>
    <base target="_self" />
</head>
<body class="floatingIframe">
    <form id="MainForm" runat="server">

    <script src="<%=BasePath %>Admin/JS/Popup.js" language="javascript" type="text/javascript"></script>

    <br />

    <style>
        body{background:none;}
        .list_page a { color:#333;border:1px solid #ccc;}
        .list_page a:hover {color:#fff;border:1px solid #aaa;background:#aaa; }
        .list_page b a {color:#fff;border:1px solid #aaa;background:#aaa; }
        .list_page input {color:#333;border:solid 1px #ccc;}

    </style>
    <asp:Repeater ID="RptFiles" runat="server">
        <HeaderTemplate>
            <table width="100%" cellpadding="0" cellspacing="1" border="0" class="model_info_table">
                <tr class="model_info_title" align="center">
                    <td>
                        <asp:Localize ID="Localize1" Text="<%$ Res: User_Accessories_ShowUploadFiles_Localize11,名称 %>"
                            runat="server" />
                    </td>
                    <td>
                        <asp:Localize ID="Localize2" Text="<%$ Res: User_Accessories_ShowUploadFiles_Localize12,大小 %>"
                            runat="server" />
                    </td>
                    <td>
                        <asp:Localize ID="Localize3" Text="<%$ Res: User_Accessories_ShowUploadFiles_Localize13,类型 %>"
                            runat="server" />
                    </td>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr class="listbg1" align="center">
                <td align="left">
                    <%# GetShowExtension(Eval("FileType").ToString().Replace("文件",""))%>
                    <%# "<span onmouseover=\"ShowADPreview('" + GetFileContent(Eval("Name").ToString(), Eval("FileType").ToString().Replace("文件", ""), Eval("Path").ToString()).Replace("\"", "&quot;") + "')\" onmouseout=\"hideTooltip('dHTMLADPreview')\">" + "<a href='javascript:ReturnUrl(\"" + Eval("Path").ToString() + "\")'>" + Eval("Name").ToString() + "</a></span>"%>
                </td>
                <td>
                    <%# GetSize(Eval("size").ToString())%>
                </td>
                <td>
                    <%# Eval("FileType").ToString()%>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </table></FooterTemplate>
    </asp:Repeater>
    <div id="dHTMLADPreview" style="z-index: 1000; left: 0px; visibility: hidden; width: 10px;
        position: absolute; top: 0px; height: 10px">
    </div>
    <div class="user_page">
        <pe:AspNetPager ID="Pager" runat="server" SimplePager="true" OnPageChanged="Pager_PageChanged">
        </pe:AspNetPager>
    </div>

    <script language="javascript" type="text/javascript">

        <!--
        function ReturnUrl(url) {
            if (<%=CKEditorFuncNum %> > 0){
            if (<%=CKEditorFuncNum %> > 100) {
            window.parent.setValue('<%= MBasePath %>' + url);
            return;
        }
            window.parent.CKEDITOR.tools.callFunction(<%=CKEditorFuncNum %>, '<%= MBasePath %>' + url, '');
            return;
                
        }
        else {
            if (url.substring(0, 1) == "/") {
                url = url.substring(1, url.length);
            }

            var thumbClientId = '<%= Request.QueryString["ThumbClientId"] %>';
            var type = '<%= Request.QueryString["Type"] %>';
            var typeName = "<%= Resources.DynamicPageResources.User_Accessories_ShowUploadFiles_JSPicture%>";
            if (type != '') {
                typeName = "<%= Resources.DynamicPageResources.User_Accessories_ShowUploadFiles_JSSoftware%>";
            }
            if (thumbClientId == '') {
                var obj = parent.document.getElementById('<%= Request.QueryString["ClientId"] %>');
                var newurl = typeName + "<%= Resources.DynamicPageResources.User_Accessories_ShowUploadFiles_JSAddress%>" + (obj.length + 1) + '|' + url;
                obj.options[obj.length] = new Option(newurl, newurl);
                ChangeHiddenFieldValue();
            }
            else {
                var obj = parent.document.getElementById(thumbClientId);
                obj.value = url;
            }
        }}

        function ChangeHiddenFieldValue() {
            var obj = parent.document.getElementById('<%= Request.QueryString["HiddenFieldId"] %>');
            var softUrls = parent.document.getElementById('<%= Request.QueryString["ClientId"] %>');
            var value = "";
            for (i = 0; i < softUrls.length; i++) {
                if (value != "") {
                    value = value + "$$$";
                }
                value = value + softUrls.options[i].value;
            }
            obj.value = value;
        }
        //-->
    </script>

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