<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Class_Add.aspx.cs" Inherits="TopWinCMS.WebUI.Admin.Common.Class_Add" %>

<%@ Register Src="../UC_AdminSelect.ascx" TagName="UC_AdminSelect" TagPrefix="uc1" %>
<%@ Register Src="../UC_AjaxLoading.ascx" TagName="UC_AjaxLoading" TagPrefix="uc2" %>
<%@ Register TagPrefix="cc1" Namespace="TopWinCMS.WebControls" Assembly="TopWinCMS.WebControls" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="ComboBox" Namespace="TopWin.WebControls.Old" TagPrefix="cc2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>添加栏目</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <meta content="no-cache" http-equiv="Pragma" />

    <script language="javascript" type="text/javascript" src="../TopWin.js"></script>

    <link href="../Style.css" rel="stylesheet" type="text/css" />

    <script language="javascript" src="../../Images/skysoft.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
        var HtmlSavePath = '<%=model.HtmlSavePath %>';
        function ShowURL()
        {
            var a = $("TB_FilePrefix").value;
            var b = $("TB_FilePostfix").value;
            var index;
            var list = document.getElementById("RBL_URLType").getElementsByTagName("INPUT");

            for (var i = 0; i < list.length; i++)
            {
                if (list[i].checked)
                    index = i;
            }

            if (index == 0)
            {
                $("show1").innerHTML = "内容页.aspx?ID=内容ID&PageNo=页码";
            }
            if (index == 1)
            {
                $("show1").innerHTML = HtmlSavePath + "栏目ID/" + a + "内容ID_页码" + b;
            }
            if (index == 2)
            {
                $("show1").innerHTML = HtmlSavePath + "2007-06/" + a + "内容ID_页码" + b;
            }
            if (index == 3)
            {
                $("show1").innerHTML = HtmlSavePath + "200706/" + a + "内容ID_页码" + b;
            }
            if (index == 4)
            {
                $("show1").innerHTML = HtmlSavePath + "200706/12/" + a + "内容ID_页码" + b;
            }
        }
        function ShowClassURL()
        {
            var a = $("TB_ClassFilePrefix").value;
            var b = $("TB_ClassFilePostfix").value;

            var index;
            var list = document.getElementById("RBL_ClassURLType").getElementsByTagName("INPUT");

            for (var i = 0; i < list.length; i++)
            {
                if (list[i].checked)
                    index = i;
            }

            if (index == 0)
            {
                $("show2").innerHTML = "内容页.aspx?ClassID=栏目ID&PageNo=页码";
            }
            if (index == 1)
            {
                $("show2").innerHTML = HtmlSavePath + "栏目ID/" + a + "栏目ID_页码" + b;
            }
            if (index == 2)
            {
                $("show2").innerHTML = HtmlSavePath + "栏目名称拼音/" + a + "栏目ID_页码" + b;
            }
            if (index == 3)
            {
                $("show2").innerHTML = HtmlSavePath + "栏目英文名称/" + a + "栏目ID_页码" + b;
            }
        }

        function OpenGradeRemark()
        {
            var index;
            var list = document.getElementById("RBL_OpenGrade").getElementsByTagName("INPUT");


            for (var i = 0; i < list.length; i++)
            {
                if (list[i].checked)
                {
                    index = i;
                }
            }

            if (index == 0)
            {
                $("show3").innerHTML = "游客可以看到该栏目拥有的内容，遇到有权限的内容由内容页进去处理。";
            }
            if (index == 1)
            {
                $("show3").innerHTML = "游客是看不到含有权限内容的链接，仅能看见免费的内容。";
            }
            if (index == 2)
            {
                $("show3").innerHTML = "全面禁止游客看到任何内容。";
            }
        }

        function HideAndDisplay(TabIndex, o)
        {
            $("current").id = "";
            for (i = 0; i < 5; i++)
            {
                if (i == TabIndex)
                {
                    o.id = "current";
                    $("Tab" + i).style.display = "block";
                }
                else
                {
                    $("Tab" + i).style.display = "none";
                }
            }
            return false;
        }
    
 
    </script>

    <style type="text/css">
        #Tab1, #Tab2, #Tab3, #Tab4
        {
            display: none;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div id="tabs">
        <ul>
            <li id="current" onclick="return HideAndDisplay(0,this);"><a href="#"><span>基本属性</span></a></li>
            <li onclick="return HideAndDisplay(1,this);"><a href="#"><span>权限设置</span></a></li>
            <li onclick="return HideAndDisplay(2,this);"><a href="#"><span>URL样式</span></a></li>
            <li onclick="return HideAndDisplay(3,this);"><a href="#"><span>其他属性</span></a></li>
            <li onclick="return HideAndDisplay(4,this);"><a href="#"><span>扩展属性</span></a></li>
        </ul>
    </div>
    <table id="Tab0" class="TabelGrid" style="width: 100%">
        <tr>
            <td class="RowTitle">
                所属栏目：
            </td>
            <td>
                <asp:DropDownList ID="DDL_Class" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                栏目名称：
            </td>
            <td>
                <asp:TextBox ID="TB_ClassName" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TB_ClassName"
                    ErrorMessage="请输入栏目名称"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                栏目英文名称：
            </td>
            <td>
                <asp:TextBox ID="TB_ClassName_EN" runat="server"></asp:TextBox>
                <br />
                不填写亦可，如果选择了用英文名称作生成HTML规则就会被用到
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                网页模板：
            </td>
            <td>
                <asp:TextBox ID="TB_TemplateFileName" runat="server" Width="250px"></asp:TextBox>

                <script type="text/javascript" language="javascript">
                    function GetTemplate()
                    {
                        var str = window.showModalDialog("../window/GetTemplate.aspx", "up", "dialogWidth=350px;dialogHeight=320px;status=0;scroll=auto");
                        if (typeof (str) != "undefined")
                            document.getElementById('TB_TemplateFileName').value = str;
                    }
                </script>

                <input id="Button1" class="btn" type="button" onclick="GetTemplate();" value="网页模板" />
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                图片存放目录：
            </td>
            <td>
                <asp:TextBox ID="TB_PicPath" runat="server" Width="296px">/UpLoadFolder/</asp:TextBox>
                <br>
                结尾必须有“/”，例如“/UpLoadFolder/”
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                是否在首页显示更新：
            </td>
            <td>
                <asp:CheckBox ID="CB_IsShowInIndex" runat="server" Checked="True" Text="(只对顶级栏目有意义)" />
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                栏目链接地址：
            </td>
            <td>
                <asp:TextBox ID="TB_LinkUrl" runat="server" Width="341px"></asp:TextBox>
                <br />
                如果想将栏目链接到外部地址，请输入完整的URL地址，否则请保持为空。
            </td>
        </tr>
    </table>
    <table id="Tab1" class="TabelGrid" style="width: 100%">
        <tr>
            <td class="RowTitle">
                内容管理员：
            </td>
            <td>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <uc1:UC_AdminSelect ID="UC_AdminSelect1" runat="server" Visible="true"></uc1:UC_AdminSelect>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                栏目管理员：
            </td>
            <td>
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <uc1:UC_AdminSelect ID="UC_AdminSelect2" runat="server" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                开放栏目设置：
            </td>
            <td>
                <asp:RadioButtonList ID="RBL_OpenGrade" runat="server" RepeatColumns="4" RepeatDirection="Horizontal"
                    onclick="OpenGradeRemark();">
                    <asp:ListItem Value="1" Selected="True">开放栏目</asp:ListItem>
                    <asp:ListItem Value="2">对游客隐藏权限内容</asp:ListItem>
                    <asp:ListItem Value="3">认证栏目</asp:ListItem>
                </asp:RadioButtonList>
                说明：<span id="show3"></span>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                是否启用投稿：
            </td>
            <td>
                <asp:RadioButtonList ID="RBL_EnableContribute" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="1" Selected="True">开启</asp:ListItem>
                    <asp:ListItem Value="0">关闭</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                是否启用评论：<br />
                <span style="font-weight: normal">用于录入内容默认值</span>
            </td>
            <td>
                <asp:RadioButtonList ID="RBL_EnableComment" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="1" Selected="True">开启</asp:ListItem>
                    <asp:ListItem Value="0">关闭</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
    </table>
    <table id="Tab2" class="TabelGrid" style="width: 100%">
        <tr>
            <td class="RowTitle">
                内容页静态文件扩展名：
            </td>
            <td>
                <asp:TextBox ID="TB_FilePostfix" runat="server">.html</asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                内容页静态文件前缀：
            </td>
            <td>
                <asp:TextBox ID="TB_FilePrefix" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                内容页生成规则：
            </td>
            <td>
                <asp:RadioButtonList ID="RBL_URLType" runat="server" RepeatDirection="Horizontal"
                    onclick="ShowURL();">
                    <asp:ListItem Value="0" Selected="True">不生成静态</asp:ListItem>
                    <asp:ListItem Value="1">静态规则一</asp:ListItem>
                    <asp:ListItem Value="2">静态规则二</asp:ListItem>
                    <asp:ListItem Value="3">静态规则三</asp:ListItem>
                    <asp:ListItem Value="4">静态规则四</asp:ListItem>
                </asp:RadioButtonList>
                样式预览：<span id="show1"></span>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                栏目静态页扩展名：
            </td>
            <td>
                <asp:TextBox ID="TB_ClassFilePostfix" runat="server" ToolTip=".html">.html</asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                栏目静态页前缀：
            </td>
            <td>
                <asp:TextBox ID="TB_ClassFilePrefix" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                栏目页生成规则：
            </td>
            <td>
                <asp:RadioButtonList ID="RBL_ClassURLType" runat="server" RepeatDirection="Horizontal"
                    onclick="ShowClassURL();">
                    <asp:ListItem Value="0" Selected="True">不生成静态</asp:ListItem>
                    <asp:ListItem Value="1">静态规则一</asp:ListItem>
                    <asp:ListItem Value="2">静态规则二</asp:ListItem>
                    <asp:ListItem Value="3">静态规则三</asp:ListItem>
                </asp:RadioButtonList>
                样式预览：<span id="show2"></span>
            </td>
        </tr>
    </table>
    <table id="Tab3" class="TabelGrid" style="width: 100%">
        <tr>
            <td class="RowTitle">
                栏目介绍<br />
                <span style="font-weight: normal">支持HTML</span>
            </td>
            <td>
                <asp:TextBox ID="TB_ClassIntro" runat="server" Height="80px" TextMode="MultiLine"
                    Width="300px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                栏目缩略图
            </td>
            <td>
                <asp:TextBox ID="TB_ClassPic" runat="server" Height="80px" TextMode="MultiLine" Width="300px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                栏目META网页描述
            </td>
            <td>
                <asp:TextBox ID="TB_ClassDescription" runat="server" Height="80px" TextMode="MultiLine"
                    Width="300px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                栏目META关键词
            </td>
            <td>
                <asp:TextBox ID="TB_ClassKeyWord" runat="server" Height="80px" Width="300px" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
    </table>
    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
        <ContentTemplate>
            <table id="Tab4" class="TabelGrid" style="width: 100%">
                <tr>
                    <td class="RowTitle">
                        拷贝其他类别属性：
                    </td>
                    <td>
                        <asp:DropDownList ID="DDL_CopyClass" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DDL_CopyClass_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="RowTitle">
                        扩展属性：
                    </td>
                    <td>
                        <asp:CheckBoxList ID="CBL_Fields" runat="server" RepeatColumns="5" RepeatDirection="Horizontal">
                        </asp:CheckBoxList>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <div style="text-align: center">
        <asp:Button ID="BT_OK" runat="server" Text="添加" OnClick="BT_OK_Click" CssClass="btn">
        </asp:Button>
    </div>

    <script type="text/javascript" language="javascript">        ShowURL(); ShowClassURL();</script>

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