<%@ Page Title="" Language="C#" MasterPageFile="../BaseMaster.Master" CodeBehind="LinkDetail.aspx.cs" Inherits="WAP2P.Web.PC.Admin.Info.LinkDetail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="header" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <form class="auto" method="post" action="" onsuccess="parent.$.jPopupEdit.close(true);">
        <div class="m-editbar">
            <input type="submit" class="btn-larger c-priority iconfont" value="&#xe684; 保存" />
            <input type="button" class="btn-larger c-normal iconfont" value="&#xe634; 关闭" onclick="parent.$.jPopupEdit.close();" />
        </div>
        <div class="m-content m-editcontent">
            <table class="m-info" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <th>链接名称</th>
                    <td>
                        <input type="text" name="linkName" id="linkName" class="w250" maxlength="50" data-vtype="must" data-vmsg="请输入链接名称" value="<%= Model.LinkName.HtmlEncode() %>" />    
                    </td>
                </tr>
                <tr>
                    <th>链接地址</th>
                    <td>
                        <input type="text" name="linkUrl" id="linkUrl" class="w250" maxlength="200" data-vtype="url" data-vmsg="请输入正确的链接地址" data-vmust="false" value="<%= Model.LinkUrl.HtmlEncode() %>" />
                        <em>以http://开头 (如果外部链接有值时，点击链接图片将直接跳转到外部链接)</em>
                    </td>
                </tr>
                <tr>
                    <th>链接图片</th>
                    <td>
                        <div id="logoResult" class="mb10"><% = IsNew || string.IsNullOrEmpty(Model.Logo) ? string.Empty : string.Format("<img src=\"{0}\" alt=\"\">", Model.Logo) %></div>
                        <div class="pl136"><input type="hidden" name="logo" id="logo" value="<% =Model.Logo.HtmlEncode() %>" /></div>
                        <input type="file" id="logoFile" />
                        <em>请上传尺寸为 <i class="fcred-3">167 X 53 像素</i> 的LOGO图片</em>
                    </td>
                </tr>
                <tr>
                    <th>是否在前台显示</th>
                    <td><div class="ui-checkbox"><% =HtmlHelper.CheckBox("isDisplay", "启用", IsNew ? true : Model.IsDisplay) %></div></td>
                </tr>
                <tr>
                    <th>排序值</th>
                    <td>
                        <input type="text" name="orderBy" class="w60 ui-int" value="<%=Model.OrderBy %>" data-vtype="number" data-vmsg="排序必须为数字" /><em>数值越大越靠前</em>
                    </td>
                </tr>
                <tr>
                    <th>链接简介</th>
                    <td>
                        <textarea name="description"><%=Model.Description.HtmlEncode() %></textarea>
                    </td>
                </tr>
                <tr>
                    <th>添加时间</th>
                    <td>
                        <%=Model.CreateAt.ToDateTimeString() %>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script>
        setTimeout(function () {
            $('#logoFile').uploadify({
                width: 120,
                height: 32,
                multi: false,
                removeTimeout: 0,
                swf: '../res/uploadify/uploadify.swf?v=<% =CryptoHelper.Random(100000,999999) %>',
                uploader: '../res/uploadify/SwfUpload.aspx?type=image&width=167&height=53',
                buttonClass:'iconfont',
                buttonText: '&#xe629; 上传链接图片',
                fileTypeExts: '<% =WAP2P.Web.PC.Admin.Res.uploadify.SwfUpload.AllowImages %>',
                formData: {
                    <% =WAP2P.Web.Admin.Membership.CookieName %> : '<% =Request.Cookies[WAP2P.Web.Admin.Membership.CookieName].Value %>'
                },
                onUploadSuccess: function(res, data) {
                    eval('var d = ' + data);
                    if (d.Success) {
                        $('#logo').val(d.Message).trigger('blur');
                        $('#logoResult').html('<img src="' + d.Message + '" />');
                    } else {
                        $.jError(d.Message);
                    }
                }
            });
        }, 10);
    </script>   
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="list" runat="server">
</asp:Content>
