<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="addAlbum.aspx.cs" Inherits="Web.User.addAlbum" %>

<!DOCTYPE html>

<html>
<!--<![endif]-->
<head>
    <title>addAlbum</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file="../Css/head.htm"-->
    <!--#include file = "../Css/userCssEdit.htm" -->
    <link rel="stylesheet" href="../Wpedt/WpdccEditor/themes/default/default.css" />

    <script language="javascript" type="text/javascript" src="../Wpedt/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../Js/ColorPicker.js" charset="utf-8"></script>
    <script type="text/javascript" src="../Wpedt/WpdccEditor/kindeditor.js"></script>

    <script type="text/javascript" src="../Wpedt/WpdccEditor/lang/zh_CN.js" charset="utf-8"></script>
    <%--    <script type="text/javascript">
    //关闭弹出层 刷新列表
    function divClose(bigclassid,menuid){
        parent.$.fancybox.close();
        parent.location="manageInfoSearch1.aspx?type="+bigclassid+"&menuId="+menuid;
    }
    </script>--%>

    <script type="text/javascript">
        jQuery(function ($) {
            $("input[type='checkbox']").addClass("ace");
            $("input[type='checkbox']").next().addClass("lbl");
        })

    </script>
    <script type="text/javascript" language="javascript">
        //自定义上传图片控件加载，支持自定义上传图片功能需先引用三个文件，[themes/default/default.css] [kindeditor.js] [lang/zh_CN.js]
        KindEditor.ready(function (K) {
            var editor = K.editor({
                uploadJson: '../Wpedt/UserEditor/aspnet/upload_json.ashx',
                fileManagerJson: '../Wpedt/UserEditor/aspnet/file_manager_json.ashx',
                allowFileManager: true
            });

            K('#uploadimg').click(function () {
                editor.loadPlugin('zdyimage', function () {
                    editor.plugin.zdyimageDialog({
                        zdyimageUrl: K('#imageName').val(),
                        clickFn: function (url) {
                            K('#imageName').val(K.formatUrl(url, 'domain'));
                            editor.hideDialog();
                            var arr = K("#imageName").val();
                            if (arr != "") {
                                K("#pho").attr('src', arr);
                            }//加载预览图片
                        }
                    });
                });
            });

        });
    </script>

    <script language="javascript" type="text/javascript">
        //保存前验证（改用统一验证js）
        function editCheck() {
            if (checkAllValidate()) {
                return true;
            }
            else {
                return false;
            }
        }

        function setcolor(type) {
            var arr = showModalDialog("../Wpedt/WpdccEditor/Dialog/selcolor.htm", "", "dialogWidth:300px; dialogHeight:260px; status:0");
            if (arr != null) {
                var button = eval("document.system." + type);
                button.value = arr;
                var table = eval(type + "Table");
                table.bgColor = arr;
            }
        }

        function setTableColor(type) {

            var button = eval("document.system." + type);
            var table = eval(type + "Table");
            table.bgColor = button.value;
        }
    </script>
</head>
<body>
    <form id="addNews" method="post" runat="server">
        <div class="edit-func-box func-box">
            <div class="hd">添加相册</div>
            <div class="bd mb80">
                <table class="edit-table" id="Table1">
                    <tr>
                        <th style="width: 20%;">相册标题：
                        </th>
                        <td colspan="3">
                            <asp:TextBox ID="albumName" runat="server" notNull="true" msgName="相册标题" class="input-md w3" MaxLength="250"></asp:TextBox>&nbsp;&nbsp;
                        <asp:CheckBox ID="isTop" runat="server" Text="固顶" CssClass="form-checkbox"></asp:CheckBox>&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <th>封面：
                        </th>
                        <td>
                            <div class="addpicnews-div pull-left">
                                <img alt="" src="../images/uploadfiles/nopic.gif" runat="server" id="pho" class="pic-div pull-left img" width="220" height="160" />
                            </div>
                            <p class="fn-pt30">
                                <a id="uploadimg" href="javascript:void(0);" class="blue">上传图片</a>
                            </p>
                            <p class="fn-pt30">
                                <span class="lgrey">封面若未上传，则会使用默认封面</span>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <th>创建时间：
                        </th>
                        <td colspan="3">
                            <asp:TextBox ID="releasetime" runat="server" MaxLength="19" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" CssClass="input-md w3"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th>相册模板：
                        </th>
                        <td>
                            <asp:DropDownList ID="itemType" runat="server" DataTextField="name" DataValueField="pkId" class="input-md w180"></asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <th>所属专题：
                        </th>
                        <td>
                            <asp:DropDownList ID="ddlspecial" runat="server" DataTextField="name" DataValueField="pkId" class="input-md w180"></asp:DropDownList>
                        </td>
                        <th>部门：
                        </th>
                        <td>
                            <asp:DropDownList ID="department" runat="server" DataTextField="name" DataValueField="pkId" class="input-md w180"></asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <th>浏览权限：
                        </th>
                        <td>
                            <asp:DropDownList ID="gate" runat="server" class="input-md w180">
                                <asp:ListItem Value="0">无限制</asp:ListItem>
                                <asp:ListItem Value="1">仅内网可见</asp:ListItem>
                                <asp:ListItem Value="2">仅登录可见</asp:ListItem>
                                <asp:ListItem Value="3">内网或登录可见</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <th>显示等级：
                        </th>
                        <td>
                            <asp:DropDownList ID="grade" runat="server" DataTextField="name" DataValueField="pkId" class="input-md w180"></asp:DropDownList>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="ft ft02">
                <div class="action-field text-center">
                    <asp:Button ID="ok" class="btn btn-sm btn-primary" runat="server" Text="添 加" OnClientClick="return checkAll();" OnClick="ok_Click"></asp:Button>&nbsp;
                <asp:Button ID="cancel" runat="server" class="btn btn-sm btn-primary" Text="取 消" CausesValidation="False" OnClick="cancel_Click"></asp:Button>&nbsp;
                </div>
                <!--/action-field-->
                <input id="imageName" type="hidden" name="imageName" runat="server" value="../Images/uploadfiles/nopic.gif" />
            </div>
        </div>

        <script type="text/javascript">

            //在保存之前,验证输入是否正确；将有效日期值转换成相应的有效天数
            function checkAll() {
                //验证
                if (checkAllValidate()) {
                    return esave();
                } else {
                    return false;
                }
            }

            //添加保存
            function esave() {

                //判断是否使用了链接标题
                if (document.getElementById("useListTitle").checked == true) {
                    var uzdyurl = document.getElementById("txtZDYUrl");
                    if (uzdyurl.value == "" || uzdyurl.value == null) {
                        alert("使用链接标题时，自定义网址不能为空！");
                        return false;
                    }
                }
                return true;
            }

        </script>
    </form>
    <!--#include file = "../Css/foot.htm" -->
</body>
</html>
