<!--#include file="../../Inc/Cls_Main.Asp"-->
<!--#include file="../inc/Cls_Admin.Asp"-->
<!--#include file="../inc/Cls_MapPath.Asp"-->
<!--#include file="../inc/Cls_Type.Asp"-->
<!--#include file="../inc/Cls_InType.Asp"-->
<!--#include file="../Admin_Check.Asp"-->
<%
Dim CmsAdmin, ToUrl
ToUrl = CmsFun.LoadToUrl()
'=============================================================================
Set CmsAdmin = New Cls_Admin
CmsAdmin.SetAdminTitle = CmsSiteName
CmsAdmin.SetBodyCssName = "mainbody"
CmsAdmin.SetAdminPath = CmsAdminMapPath
CmsAdmin.LoadHead()
'=============================================================================
Dim ChannelId, ChannelName, BriefName, TabName, ChannelPath, ModelId
ChannelId = Easp.Get("ChannelId:n:0")
If ChannelId = 0 Then
    CmsAdmin.JscriptMsg "频道参数错误！", "", "Error", "null"
End If
' 读取频道信息
Dim ArrayChannel
ArrayChannel = GetCaCheChannelInfo("Channel", ChannelId, ChannelField)
If Easp.IsN(ArrayChannel) Then
    CmsAdmin.JscriptMsg "不存在的频道！", "", "Error", "null"
Else
    ChannelName = ArrayChannel(0)
    BriefName = ArrayChannel(1)
    TabName = ArrayChannel(2)
    ModelId = ArrayChannel(3)
    ChannelPath = ArrayChannel(4)
End If
'=============================================================================
Dim Action
'=============================================================================
Action = Easp.Get("action")
Select Case Action
    Case "pageload"
        Call PageLoad()
    Case "px"
        Call Px()
    Case "delall"
        Call DelAll()
    Case Else
        Call PageLoad()
End Select
CmsAdmin.LoadFooter()
Set CmsAdmin = Nothing

Sub PageLoad()
    ' 读取分类
    Dim objType, SelectList
    Set objType = New Cls_Type
    SelectList = objType.ShowSelectList("选择分类", ChannelId, 0, 1)
    Set objType = Nothing
%>
<script>
function CreateLable() {
    var TempLable = '';
    TempLable += '{zjjcms:datalist ChannelId="' + $('#ChannelId').val() + '"';
    if ($('#ClassId').val() != null && $('#ClassId').val() != 0) {
        TempLable += ' ClassId="' + $('#ClassId').val() + '"';
    }
    if ($('input[name="DataIsTop"]:checked').val() == 1) {
        TempLable += ' istop="1"';
    }
    if ($('input[name="DataIsBest"]:checked').val() == 1) {
        TempLable += ' isbest="1"';
    }
    if ($('input[name="DataIsHot"]:checked').val() == 1) {
        TempLable += ' ishot="1"';
    }
    if ($('input[name="DataIsImages"]:checked').val() == 1) {
        TempLable += ' ispic="1"';
    }
    if ($('#DataNum').val() != 0) {
        TempLable += ' num="' + $('#DataNum').val() + '"';
    }
    if ($('#IdVal').val() != '') {
        TempLable += ' id="' + $('#IdVal').val() + '"';
    }
    if ($('#OrderVal').val() != 0) {
        TempLable += ' order="' + $('#OrderVal').val() + '"';
    }
    TempLable += '}\n';
    if ($('#HtmlCode').val() != '') {
        TempLable += $('#HtmlCode').val() + '\n';
    } else {
        TempLable += '这里填写您循环代码\n';
    }
    TempLable += '{/zjjcms:datalist}';
    $('#Content').val(TempLable);
}
</script>
<input type="hidden" name="ChannelId" id="ChannelId" value="<%=ChannelId%>" />
<div class="navigation"><a href="Admin.Tag.Asp" class="back">标签向导</a> 控制面板 &gt; 标签向导 &gt; <%=ChannelName%>标签生成</div>
<div id="contentTab">
  <div class="content-tab">
    <ul class="tab_nav">
      <li><a onclick="tabs(this);" class="selected" href="javascript:void(0);">标签生成</a></li>
    </ul>
  </div>
  <div class="tab_con" style="display: block;">
    <table class="form_table">
      <col width="230px">
        </col>
      
      <tbody>
        <tr>
          <th> 调用类型： </th>
          <td><%=SelectList%>
            <label> 按住：Ctrl或Shift键进行多选</label></td>
        </tr>
        <tr>
          <th> 特殊属性： </th>
          <td><span id="cblItem">
            <input id="cblItem_0" type="checkbox" name="DataIsTop" value="1" />
            <label for="cblItem_0">置顶</label>
            <input id="cblItem_1" type="checkbox" name="DataIsBest" value="1" />
            <label for="cblItem_1">推荐</label>
            <input id="cblItem_2" type="checkbox" name="DataIsHot" value="1" />
            <label for="cblItem_2">热门</label>
            <input id="cblItem_3" type="checkbox" name="DataIsImages" value="1" />
            <label for="cblItem_3">是否只调有图</label>
            </span></td>
        </tr>
        <tr>
          <th> 调用条数： </th>
          <td><input type="text" class="txtInput w100" name="DataNum" id="DataNum" maxlength="5" value="10" onfocus="ChkNumEric(this)" autocomplete="off" />
            <label> 为空或0则显示10条</label></td>
        </tr>
        <tr>
          <th> 调用指定ID数据： </th>
          <td><input type="text" class="txtInput w200" name="IdVal" id="IdVal" maxlength="5" autocomplete="off" />
            <label> 多个以逗号隔开,如：22,23,24</label></td>
        </tr>
        <tr>
          <th> 排序方式： </th>
          <td><select name="OrderVal" id="OrderVal" class="select2">
              <option value="0">选择排序[添加时间]</option>
              <option value="1">更新时间</option>
              <option value="2">指定排序</option>
              <option value="3">人气</option>
            </select></td>
        </tr>
        <tr>
          <th> 循环体内可调用字段： </th>
          <td><textarea name="FieldList" id="FieldList" class="w550"><%=SelectTableField(TabName)%></textarea></td>
        </tr>
        <tr>
          <th> 字段可支持属性： </th>
          <td>datetime,len,return</td>
        </tr>
        <tr>
          <th> 循环体内Html标签： </th>
          <td><textarea name="HtmlCode" id="HtmlCode" class="w550">这里填写您循环代码</textarea></td>
        </tr>
        <tr>
          <th> 生成标签结果： </th>
          <td><textarea name="Content" id="Content" class="w550"></textarea></td>
        </tr>
        <tr>
          <th> </th>
          <td><input type="button" value="生成标签" class="btnSubmit" onclick="CreateLable();" />
            &nbsp;
            <input name="重置" type="reset" class="btnSubmit" value="重 置" /></td>
        </tr>
      </tbody>
    </table>
  </div>
</div>
<%
End Sub
%>
