<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" MasterPageFile="../Global.Master" CodeBehind="Class.aspx.cs" Inherits="Web.AdminManager.Setting.Class" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../js/Setting.Class.js" type="text/javascript"></script>
    <%if (Action == "Edit" || Action == "Add")
      { %>
    <script src="/Common/UEditor/editor_config.js" type="text/javascript"></script>
    <script src="/Common/UEditor/editor_all_min.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="/Common/UEditor/themes/default/ueditor.css" />
    <%} %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <div style="display:none;" class="hidClassType"><%=ClassType %></div>
        <ul class="ui-nav-tabs clearfix">
            <%
                if (AgentUserId == 1)
                {
                    Response.Write(CommonLib.Helper.StringFromEnum(typeof(CommonLib.Enums.ClassType), "<li {2}><a href=\"Class.aspx?ClassType={1}\">{0}</a></li>", ClassType, "class=\"active\""));
                }
                else
                {
                    Response.Write(CommonLib.Helper.StringFromEnum(typeof(CommonLib.Enums.ClassType), "<li {2}><a href=\"Class.aspx?ClassType={1}\">{0}</a></li>", ClassType, "class=\"active\"", new int[]{
                                CommonLib.Enums.ClassType.虚拟主机.GetHashCode(),
                                CommonLib.Enums.ClassType.域名.GetHashCode(),
                                CommonLib.Enums.ClassType.邮局.GetHashCode(),
                                CommonLib.Enums.ClassType.SQL.GetHashCode(),
                                CommonLib.Enums.ClassType.MySQL.GetHashCode(),
                                CommonLib.Enums.ClassType.服务器租用.GetHashCode(),
                                CommonLib.Enums.ClassType.服务器托管.GetHashCode(),
                                CommonLib.Enums.ClassType.VPS.GetHashCode(),
                                CommonLib.Enums.ClassType.普通商品.GetHashCode(),
                                CommonLib.Enums.ClassType.成功案例.GetHashCode(),
                                CommonLib.Enums.ClassType.文章.GetHashCode(),
                                CommonLib.Enums.ClassType.下载.GetHashCode(),
                                CommonLib.Enums.ClassType.有问必答.GetHashCode()
                                }));
                }
            %>
        </ul>
    </div>
    <div class="h8"></div>
    <div id="UI_NewOrder" runat="server" visible="false">
        <form action="" name="chkOrders" method="post">
            <ul>
                <%=OutNewOrderStr %>
                <li>
                    <a class="ui-btn ui-btn-primary" href="Class.aspx?ClassType=<%=ClassType %>">返回</a></li>
            </ul>
        </form>
    </div>
    <div id="UI_Edit" runat="server" visible="false">
        <form action="" method="post" class="ui-form ui-form-vertical">
            <div class="ui-form-group">
                <label class="ui-form-label">分类名称</label><div class="ui-form-ctrls">
                    <input type="text" name="ClassName" id="ClassName"
                        class="ui-input-small" value="<%=mac.ClassName %>" /><span
                            class="ClassName ui-help-inline">分类名称</span>
                </div>
            </div>
            <div class="ui-form-group">
                <label class="ui-form-label">上级分类</label><div class="ui-form-ctrls">
                    <select size="1" name="ParentId" id="ParentId">
                        <%=ParentSelectStr %>
                    </select><span class="ParentId ui-help-inline">该分类的所属上级分类</span>
                </div>
            </div>
            <%if (ClassType == CommonLib.Enums.ClassType.栏目.GetHashCode())
              { %>
            <div class="ui-form-group">
                <label class="ui-form-label">链接地址</label><div class="ui-form-ctrls">
                    <select size="1" name="LinkType" id="LinkType">
                        <option value="">自定义链接</option>
                        <option value="/">首页</option>
                        <%=LinkTypeSelectStr %>
                    </select><input type="text" name="LinkUrl" id="LinkUrl"
                        value="<%=mac.LinkUrl %>" /><span class="LinkUrl ui-help-inline">栏目的链接地址，<a href="http://help.qzsys.com/archives/19"
                            target="_blank">点击查看帮助</a></span>
                </div>
            </div>
            <div class="ui-form-group">
                <label class="ui-form-label">链接方式</label><div class="ui-form-ctrls">
                    <select size="1" name="Target" id="Target">
                        <option value="0" <%=mac.Target==0?"":"selected" %>>同一窗口</option>
                        <option value="1" <%=mac.Target==1?"selected":"" %>>新建窗口</option>
                    </select><span class="Target ui-help-inline">点击栏目链接时窗口打开方式</span>
                </div>
            </div>
            <%} %>
            <div class="ui-form-group">
                <label class="ui-form-label">分类介绍：</label><div class="ui-form-ctrls">
                    <script id="ClassInfo" type="text/plain"><%=mac.Info %></script>
                    <script type="text/javascript">
                        var editor = new baidu.editor.ui.Editor({
                            textarea: 'ClassInfo'
                        });
                        editor.render("ClassInfo");
                    </script>
                </div>
            </div>
            <div class="ui-form-group">
                <label class="ui-form-label">&nbsp;</label><div class="ui-form-ctrls">
                    <button class="ui-btn ui-btn-primary" type="submit">提交保存</button>&nbsp;
                    <button type="button" onclick="history.back();" class="ui-btn">返回</button>
                </div>
            </div>
        </form>
    </div>
    <div id="UI_Default" runat="server" visible="false">
        <form action="?Action=IndexOrder&ClassType=<%=ClassType %>" method="post">
            <table class="ui-table ui-table-bordered">
                <thead>
                    <tr>
                        <td colspan="6">
                            <div class="ui-btn-group">
                                <a class="ui-btn ui-btn-primary" href="?Action=Add&ClassType=<%=ClassType %>">创建分类</a>
                                <a class="ui-btn ui-btn-primary" href="?ClassType=<%=ClassType %>&Action=newclassOrders">子级排序</a>
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <th>Id编号
                        </th>
                        <th>分类名称
                        </th>
                        <th>排序
                        </th>
                        <th>操作
                        </th>
                    </tr>
                </thead>
                <%=ShowList %>
                <tr>
                    <td colspan="4">
                        <button class="ui-btn ui-btn-primary">
                            保存排序</button><span class="IndexOrderMsg"></span>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</asp:Content>
