<%@ page language="C#" autoeventwireup="true" inherits="admin_style_SetStyle, DianCMS" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Import Namespace="D.Common" %>
<%@ Import Namespace="D.BLL" %>

<!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 runat="server">
    <title></title>
    <link id="CssName" rel="stylesheet" type="text/css" runat="server" />
    <link rel="Stylesheet" type="text/css" href="../css/RightMenu.css" />
    <script src="../../js/Common.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../js/rightmenu.js"></script>
    <asp:Literal ID="LitTableJs" runat="server"></asp:Literal>
    <script type="text/javascript" src="../../js/<%=B_Lang.getLang() %>/Copy.js"></script>
    <script src="../../js/lhgdialog/lhgcore.lhgdialog.min.js?self=true&skin=<%=Function.GetCssNameColor()%>" type="text/javascript"></script>

    <script type="text/javascript">
        function SelUsType() {
            var TypeCount = document.getElementsByName("RadUsType");
            var p = 0;
            if (navigator.appName == "Microsoft Internet Explorer") {
                p = 1;
            }
            for (var i = p; i < TypeCount.length; i++) {
                if (TypeCount[i].checked) {
                    switch (TypeCount[i].value) {
                        case "1":
                            DianCMS_$("Content").style.display = "none";
                            DianCMS_$("ColumnRep").style.display = "";
                            DianCMS_$("ColumnNav").style.display = "none";
                            DianCMS_$("ModelField").style.display = "";
                            break;
                        case "2":
                        case "3":
                            DianCMS_$("ColumnRep").style.display = "none";
                            DianCMS_$("ColumnNav").style.display = "";
                            DianCMS_$("Content").style.display = "none";
                            DianCMS_$("ModelField").style.display = "none";
                            break;
                        case "4":
                            DianCMS_$("ColumnRep").style.display = "none";
                            DianCMS_$("ColumnNav").style.display = "none";
                            DianCMS_$("Content").style.display = "";
                            DianCMS_$("ModelField").style.display = "";
                            break;
                    }
                    break;
                }
            }
        }

        function selectStyleclass(id) {
            window.location.href = "StyleList.aspx?ParentId=" + id + "";
        }
    </script>
    <style>
        .btn2 { margin:1px 0px;}
    </style>
</head>
<body>
    <form id="form1" runat="server" onkeydown="Save()">
    <table class="dh" cellpadding="0" cellspacing="0" border="0" align="center">
        <tr>
            <td>
                <table width="100%"><tr><td>
                <asp:Image ID="P_Go" runat="server" ImageAlign="AbsMiddle" />
                您现在的位置：<a href="../info.aspx">后台管理</a> >>
                <asp:Literal ID="LitModel" runat="server"></asp:Literal>
                >> 设置样式</td><td align="right"><asp:DropDownList
                    ID="dropStyleClass" runat="server" onchange="selectStyleclass(this.value)">
                        <asp:ListItem Value="0">快速进入样式列表</asp:ListItem>
                </asp:DropDownList></td></tr></table>
            </td>
        </tr>
    </table>
    <table class="border" cellspacing="1" cellpadding="0" width="99%" border="0" align="center">
        <tr>
            <td class="bqleft">
                样式名称：
            </td>
            <td class="bqright">
                <asp:TextBox ID="txtName" runat="server" CssClass="in1" Columns="50"></asp:TextBox><asp:DropDownList
                    ID="StyleClass" runat="server">
                    <asp:ListItem Value="0">选择分类</asp:ListItem>
                </asp:DropDownList>
                <font color="#ff0066">*</font>
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                使用类型：
            </td>
            <td class="bqright">
                <asp:RadioButtonList ID="RadUsType" runat="server" RepeatDirection="Horizontal" onclick="SelUsType()">
                    <asp:ListItem Value="1" Selected="True">列表样式</asp:ListItem>
                    <asp:ListItem Value="3">栏目展示</asp:ListItem>
                    <asp:ListItem Value="4">内容浏览</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tbody id="ColumnRep" runat="server">
            <tr>
                <td class="bqleft">
                    关联字段：
                </td>
                <td class="bqright">
                    <table width="100%" cellpadding="1" cellspacing="0" border="0">
                        <tr>
                            <td width="13%">
                                <div onclick="CreateRange('txtHtml','{D_F_InfoUrl}')" class="fieldstyle" title="点击选择该字段">内容URL</div>
                            </td>
                            <td width="13%">
                                <div onclick="CreateRange('txtHtml','{D_F_For#for(1,10)}')" class="fieldstyle" title="点击选择该字段{D_F_For#for(开始循环数,循环次数)}">行编号（m......n）</div>
                            </td>
                            <td width="13%">
                                <div onclick="CreateRange('txtHtml','{D_F_ItemIndex#for(1)}')" class="fieldstyle" title="点击选择该字段{D_F_ItemIndex#for(开始循环数)}">行固定位置号</div>
                            </td>
                            <td width="13%" align="center">
                                <input id="Button7" type="button" value="其他表字段值" class="btn" style="width: 99%" onclick="WinOpenLhgFocusDialog('txtHtml','关联其他表字段值','../common/RelTable.aspx?Control=txtHtml&TableName=<%=TableName %>', 450, 225,'')" />
                            </td>
                            <td width="13%" align="center">
                                <input id="Button16" type="button" value="评论总数" class="btn" style="width: 99%" onclick="WinOpenLhgFocusDialog('txtHtml','获取内容评论数','../style/Function.aspx?tableName=<%=TableName %>&Type=comment&ControlId='+escape('txtHtml')+'',500,155,'')" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </tbody>
        <tbody id="ColumnNav" style="display: none" runat="server">
            <tr>
                <td class="bqleft">
                    栏目字段：
                </td>
                <td class="bqright">
                    <table width="100%" cellpadding="1" cellspacing="0" border="0">
                        <tr>
                            <td width="20%">
                                <div onclick="CreateRange('txtHtml','{D_F_ColId}')" class="fieldstyle" title="点击选择该字段">
                                    栏目Id
                                </div>
                            </td>
                            <td width="20%">
                                <div onclick="CreateRange('txtHtml','{D_F_CnName}')" class="fieldstyle" title="点击选择该字段">
                                    栏目中文名称
                                </div>
                            </td>
                            <td width="20%">
                                <div onclick="CreateRange('txtHtml','{D_F_EnName}')" class="fieldstyle" title="点击选择该字段">
                                    栏目英文名称
                                </div>
                            </td>
                            <td width="20%">
                                <div onclick="CreateRange('txtHtml','{D_F_ColumnUrl}')" class="fieldstyle" title="点击选择该字段">
                                    栏目Url
                                </div>
                            </td>
                            <td width="20%">
                                <div onclick="CreateRange('txtHtml','{D_F_Image}')" class="fieldstyle" title="点击选择该字段">
                                    栏目图片
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div onclick="CreateRange('txtHtml','{D_F_Keywords}')" class="fieldstyle" title="点击选择该字段">
                                    栏目关键词
                                </div>
                            </td>
                            <td>
                                <div onclick="CreateRange('txtHtml','{D_F_Description}')" class="fieldstyle" title="点击选择该字段">
                                    栏目描述
                                </div>
                            </td>
                            <td>
                                <div onclick="CreateRange('txtHtml','{D_F_InfoCount}')" class="fieldstyle" title="点击选择该字段">
                                    数量统计(总数)
                                </div>
                            </td>
                            <td>
                                <div onclick="CreateRange('txtHtml','{D_F_InfoWeekCount}')" class="fieldstyle" title="点击选择该字段">
                                    数量统计(按周)
                                </div>
                            </td>
                            <td>
                                <div onclick="CreateRange('txtHtml','{D_F_InfoMonthCount}')" class="fieldstyle" title="点击选择该字段">
                                    数量统计(按月)
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div onclick="CreateRange('txtHtml','{D_F_ExpandField1}')" class="fieldstyle" title="点击选择该字段">
                                    自由字段1
                                </div>
                            </td>
                            <td>
                                <div onclick="CreateRange('txtHtml','{D_F_ExpandField2}')" class="fieldstyle" title="点击选择该字段">
                                    自由字段2
                                </div>
                            </td>
                            <td>
                                <div onclick="CreateRange('txtHtml','{D_F_ExpandField3}')" class="fieldstyle" title="点击选择该字段">
                                    自由字段3
                                </div>
                            </td>
                            <td>
                                <div onclick="CreateRange('txtHtml','{D_F_ExpandField4}')" class="fieldstyle" title="点击选择该字段">
                                    自由字段4
                                </div>
                            </td>
                            <td>
                                <div onclick="CreateRange('txtHtml','{D_F_ExpandField5}')" class="fieldstyle" title="点击选择该字段">
                                    自由字段5
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </tbody>
        <tbody id="Content" style="display: none" runat="server">
            <tr>
                <td class="bqleft">
                    关联字段：
                </td>
                <td class="bqright">
                    <table width="100%" cellpadding="1" cellspacing="0" border="0" align="center">
                        <tr>
                            <td width="13%">
                                <input id="Button9" type="button" value=" 上一篇 " onclick="WinOpenLhgFocusDialog('txtHtml','选择上一篇字段','../common/PreOrNext.aspx?PreOrNext=pre&Control=txtHtml&TableName=<%=TableName %>',400, 150,'')"
                                    class="btn" style="width: 100%" />
                            </td>
                            <td width="13%">
                                <div onclick="CreateRange('txtHtml','{D_F_PreUrl}')" class="fieldstyle" title="点击选择该字段">
                                    上一篇URL
                                </div>
                            </td>
                            <td width="13%">
                                <input id="Button8" type="button" value=" 下一篇 " class="btn" style="width: 100%" onclick="WinOpenLhgFocusDialog('txtHtml','选择下一篇字段','../common/PreOrNext.aspx?PreOrNext=next&Control=txtHtml&TableName=<%=TableName %>', 400, 150,'')" />
                            </td>
                            <td width="13%">
                                <div onclick="CreateRange('txtHtml','{D_F_NextUrl}')" class="fieldstyle" title="点击选择该字段">
                                    下一篇URL
                                </div>
                            </td>
                            <td width="13%">
                                <input id="Button5" type="button" value="其他表字段" class="btn" style="width: 99%" onclick="WinOpenLhgFocusDialog('txtHtml','关联其他表字段','../common/RelTable.aspx?Control=txtHtml&TableName=<%=TableName %>', 400, 265,'')" />
                            </td>
                            <td width="13%">
                                <input id="Button17" type="button" value="评论总数" class="btn" style="width: 99%" onclick="WinOpenLhgFocusDialog('txtHtml','获取内容评论数量','../common/Comment.aspx?Control=txtHtml', 450, 220,'')" />
                            </td>
                        </tr>
                        <tr>
                            <td width="13%">
                                <div onclick="CreateRange('txtHtml','{D_F_Model_ModelId}')" class="fieldstyle" title="点击选择该字段">
                                    模型ID
                                </div>
                            </td>
                            <td width="13%">
                                <div onclick="CreateRange('txtHtml','{D_F_Model_ModelEnName}')" class="fieldstyle" title="点击选择该字段">
                                    模型名称(En)
                                </div>
                            </td>
                            <td width="13%">
                                <div onclick="CreateRange('txtHtml','{D_F_Model_ModelDesc}')" class="fieldstyle" title="点击选择该字段">
                                    模型描述
                                </div>
                            </td>
                            <td width="13%">
                                <div onclick="CreateRange('txtHtml','{D_F_Column_ColId}')" class="fieldstyle" title="点击选择该字段">
                                    栏目ID
                                </div>
                            </td>
                            <td width="13%">
                                <div onclick="CreateRange('txtHtml','{D_F_Column_CnName}')" class="fieldstyle" title="点击选择该字段">
                                    栏目名称(Cn)
                                </div>
                            </td>
                            <td width="13%">
                                <div onclick="CreateRange('txtHtml','{D_F_Column_Description}')" class="fieldstyle" title="点击选择该字段">
                                    栏目描述
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </tbody>
        <tbody id="ModelField" runat="server">
            <tr>
                <td class="bqleft">
                    <asp:Literal ID="LitModelName" runat="server"></asp:Literal>字段：
                </td>
                <td class="bqright">
                    <asp:DataList ID="DataList1" runat="server" RepeatColumns="6" RepeatDirection="Horizontal"
                        Width="100%">
                        <ItemStyle Width="13%" />
                        <ItemTemplate>
                            <div onclick="CreateRange('txtHtml','{D_F_<%# Eval("Name") %>}')" class="fieldstyle" title="点击选择该字段到录入界面">
                                <%# Eval("Alias")%>
                            </div>
                        </ItemTemplate>
                    </asp:DataList>
                    <asp:DataList ID="DataList2" runat="server" RepeatColumns="4" RepeatDirection="Horizontal"
                        Width="100%">
                        <ItemStyle Width="25%" />
                        <ItemTemplate>
                            <div onclick="CreateRange('txtHtml','<%# Eval("FieldValue") %>')" class="fieldstyle" title="点击选择该字段到录入界面">
                                <%# Eval("FieldName")%>
                            </div>
                        </ItemTemplate>
                    </asp:DataList>
                </td>
            </tr>
        </tbody>
        <tr>
            <td class="bqleft">
                备用代码：
            </td>
            <td class="bqright">
                <input id="Button1" type="button" value="<table>" class="btn btn2" onclick="Win_Open('../common/table.aspx?Control=txtHtml','','550','415')" />
                <input id="Button4" type="button" value="<div>" class="btn btn2" onclick="Win_Open('../common/div.aspx?Control=txtHtml','','550','150')" />
                <input id="Button2" type="button" value="<tr/>" class="btn btn2" onclick="CreateRange('txtHtml','<tr></tr>')" />
                <input id="Button3" type="button" value="<td/>" class="btn btn2" onclick="CreateRange('txtHtml','<td></td>')" />
                <input id="Button31" type="button" value="<div/>" class="btn btn2" onclick="CreateRange('txtHtml','<div></div>')" />
                <input id="Button32" type="button" value="<ul/>" class="btn btn2" onclick="CreateRange('txtHtml','<ul></ul>')" />
                <input id="Button33" type="button" value="<li/>" class="btn btn2" onclick="CreateRange('txtHtml','<li></li>')" />
                <input id="Button34" type="button" value="<span/>" class="btn btn2" onclick="CreateRange('txtHtml','<span></span>')" />
                <input id="Button35" type="button" value="<font/>" class="btn btn2" onclick="CreateRange('txtHtml','<font></font>')" />
                <input id="Button24" type="button" value="<p/>" class="btn btn2" onclick="CreateRange('txtHtml','<p></p>')" />
                <input id="Button26" type="button" value="<a/>" class="btn btn2" onclick="CreateRange('txtHtml','<a href=&quot;{D_F_InfoUrl}&quot; target=&quot;_blank&quot;></a>')" />
                <input id="Button27" type="button" value="<h1/>" class="btn btn2" onclick="CreateRange('txtHtml','<h1></h1>')" />
                <input id="Button28" type="button" value="<dianloop/>" class="btn btn2" title="循环一个列表时，可以展示不同的样式" onclick="CreateRange('txtHtml','<dianloop=1 id=&quot;d1&quot;>\r\n<li></li>\r\n</dianloop>')" />
                <input id="Button30" type="button" value="<dianaspx/>" class="btn btn2" onclick="CreateRange('txtHtml','<dianaspx template=&quot;&quot;>\r\nstring[] diancms={&quot;dian&quot;,&quot;cms&quot;};\r\nstring v=string.Empty;\r\nfor(int i=0;i<diancms.Length;i++)\r\n{\r\nv+=diancms[i]+&quot;--&quot;;\r\}\r\nResponse.Write(v);\r\n</dianaspx>')" title="完全支持程序语言"/>
                <input id="Button20" type="button" value="内容ID" class="btn btn2" onclick="CreateRange('txtHtml','{D_F_Id}')" />
                <input id="Button29" type="button" value="标签参数" class="btn btn2" onclick="CreateRange('txtHtml','@ParameValue1')" title="参数一（@ParameValue1）、参数二（@ParameValue2）"/>
                <input id="Button21" type="button" value="虚拟目录" class="btn btn2" onclick="CreateRange('txtHtml','{D_F_ApplicationRootPath}')" />
                <input id="Button22" type="button" value="上传目录" class="btn btn2" onclick="CreateRange('txtHtml','{D_F_AppUploadFolder}')" />
                <input id="Button36" type="button" value="内容中第一张图" class="btn btn2" title="请将Content替换您实际的字段名称" onclick="CreateRange('txtHtml','{D_F_Content#InfoImg()}')" />
            </td>
        </tr>
        <tr>
            <td class="bqleft">
                可使用函数：
            </td>
            <td class="bqright">
                <input id="Button10" type="button" value="字符截取" class="btn btn2" onclick="WinOpenLhgFocusDialog('txtHtml','字符截取','../style/Function.aspx?tableName=<%=TableName %>&Type=len&ControlId=txtHtml',500,205,'')" />
                <input id="Button11" type="button" value="时间格式化" class="btn btn2" onclick="WinOpenLhgFocusDialog('txtHtml','时间格式化','../style/Function.aspx?tableName=<%=TableName %>&Type=formattime&ControlId=txtHtml', 500, 200,'')" />
                <input id="Button14" type="button" value="字符替换" class="btn btn2" onclick="WinOpenLhgFocusDialog('txtHtml','字符替换','../style/Function.aspx?tableName=<%=TableName %>&Type=replace&ControlId=txtHtml', 500, 180,'')" />
                <input id="Button15" type="button" value="字符拆分" class="btn btn2" onclick="WinOpenLhgFocusDialog('txtHtml','字符拆分','../style/Function.aspx?tableName=<%=TableName %>&Type=split&ControlId=txtHtml', 500, 180,'')" />
                <input id="Button12" type="button" value="图片等比例宽度" class="btn btn2" onclick="WinOpenLhgFocusDialog('txtHtml','获取图片等比例宽度','../style/Function.aspx?tableName=<%=TableName %>&Type=width&ControlId=txtHtml', 500,160,'')" />
                <input id="Button13" type="button" value="图片等比例高度" class="btn btn2" onclick="WinOpenLhgFocusDialog('txtHtml','获取图片等比例高度','../style/Function.aspx?tableName=<%=TableName %>&Type=height&ControlId=txtHtml', 500, 160,'')" />
                <input id="Button18" type="button" value="最新内容标识" class="btn btn2" onclick="WinOpenLhgFocusDialog('txtHtml','获取最新内容标识符','../style/Function.aspx?tableName=<%=TableName %>&Type=InfoNew&ControlId=txtHtml', 500, 220,'')" />
                <input id="Button19" type="button" value="字符编码/解码" class="btn btn2" onclick="WinOpenLhgFocusDialog('txtHtml','字符编码/解码','../style/Function.aspx?tableName=<%=TableName %>&Type=Encode&ControlId=txtHtml', 550, 180,'')" />
                <input id="Button23" type="button" value="用户空间链接URL" class="btn btn2" onclick="CreateRange('txtHtml','{D_F_UserId#userspaceurl(index)}')" />
                <input id="Button25" type="button" value="&lt;%%&gt;" class="btn btn2" onclick="WinOpenLhgFocusDialog('txtHtml','易点CMS独创函数设置','../common/duchuang.aspx',650,400,'')"/>
                <input id="Button37" type="button" value="特殊符号" class="btn btn2" onclick="WinOpenLhgFocusDialog('txtHtml','特殊符号','../common/symbol.aspx',650,270,'')"/>
            </td>
        </tr>
        <tbody runat="server" visible="false" id="DivShop">
            <tr>
                <td class="bqleft">商城模型：</td>
                <td class="bqright"><input id="ShopCart" type="button" value=" 购买按钮 " runat="server" class="btn" /><input id="Button38" type="button" value=" 商品规格 " runat="server" class="btn" title="把里面的1换成需要调用的规格编号" onclick="CreateRange('txtHtml','{D_F_Specifications#read(1,<a href=&quot;&quot;>text</a>)}')"/></td>
            </tr>
        </tbody>
        <tr>
            <td class="bqleft">
                样式内容：
            </td>
            <td class="bqright">
                <asp:TextBox ID="txtHtml" runat="server" Height="300px" TextMode="MultiLine" Width="99%" Style="word-break: break-all; word-wrap: break-word;"></asp:TextBox><br />
                <table width="99%" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td bgcolor="#e0dfe3" align="right">
                            <a href="javascript:" onclick="runEx('txtHtml')">
                                <img src="../images/PreView.gif" border="0" title="预览录入界面" /></a> <a href="javascript:"
                                    onclick="copyToClipboard(document.form1.txtHtml.value)">
                                    <img src="../images/copy.gif" border="0" title="复制录入界面" style="margin-left: 20px" /></a>
                            <a href="javascript:" onclick="SizePlus('txtHtml')" title="增加编辑高度">
                                <img src="../images/sizeplus.gif" border="0" style="margin-left: 20px;" /></a>
                            <a href="javascript:" onclick="SizeMinus('txtHtml')">
                                <img src="../images/sizeminus.gif" border="0" title="减少编辑高度" style="margin-left: 20px;
                                    margin-right: 20px" /></a>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="bqleft">
            </td>
            <td class="bqright" height="40">
                <asp:Button ID="DianCMS_Submit" runat="server" Text=" 确认(Ctrl+s) " CssClass="btn radius30 pad_0_30"
                    OnClick="Button5_Click" />
                <input id="Button6" type="button" value=" 取消 " onclick="window.location.href='StyleList.aspx'"
                    class="btn radius30 pad_0_30" style="margin-left: 20px" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
