<!--#include file="../../Inc/Cls_Main.Asp"-->
<!--#include file="../inc/Cls_Admin.Asp"-->
<!--#include file="../inc/Cls_MapPath.Asp"-->
<!--#include file="../Admin_Check.Asp"-->
<%
Dim CmsAdmin
'=============================================================================
Set CmsAdmin = New Cls_Admin
CmsAdmin.SetAdminTitle = CmsSiteName
CmsAdmin.SetBodyCssName = "mainbody"
CmsAdmin.SetAdminPath = CmsAdminMapPath
CmsAdmin.LoadHead()
'=============================================================================
Dim Action
'=============================================================================
Action = Easp.Get("action")
Select Case Action
    Case "savemain"
        Call SaveMain()
    Case Else
        Call PageLoad()
End Select
CmsAdmin.LoadFooter()
Set CmsAdmin = Nothing

Sub PageLoad()
%>
<script src="<%=CmsAdminMapPath%>js/check/free.tag.check.js"></script>
<form name="myform" id="myform" method="post" action="?action=savemain" onsubmit="return CheckForm();">
  <div class="navigation"><a href="Admin.Tag.List.Asp" class="back">自定义标签管理</a> 控制面板 &gt; 自定义标签管理 &gt; 添加标签 </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="200px">
          </col>
        
        <tbody>
          <tr>
            <th> 自定义标签名称： </th>
            <td class="td2"><input type="text" class="txtInput w350" name="Title" id="Title" maxlength="150" autocomplete="off" />
              <label> *不需要加：{ZjjCmsTag:},不可重复</label></td>
          </tr>
          <tr id="trd3">
            <th> 自定义标签描述： </th>
            <td class="td2"><input type="text" class="txtInput w350" name="Info" id="Info" maxlength="150" autocomplete="off" />
              <span class="Validform_checktip">*</span></td>
          </tr>
          <tr>
            <th> 自定义标签内容： </th>
            <td class="td2"><textarea name="Content" id="Content" class="big"></textarea>
              <label> 支持Html</label></td>
          </tr>
          <tr>
            <th></th>
            <td><input type="submit" class="btnSubmit" value="提交保存" />
              &nbsp;
              <input name="重置" type="reset" class="btnSubmit" value="重 置" /></td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</form>
<%
End Sub

Sub SaveMain()
    ChkSysAdminLevel "sys_free", "add"
    '=====================================================================
    Dim Title, Info, Content
    Title = Trim(Easp.Post("Title:s"))
    Info = Trim(Easp.Post("Info:s"))
    Content = Trim(Easp.Post("Content:s"))
    '=====================================================================
    If Easp.IsN(Title) Then
        CmsAdmin.JscriptMsg "自定义标签名称不能为空！", "back", "Error", "null"
    End If
    If Easp.IsN(Info) Then
        CmsAdmin.JscriptMsg "自定义标签描述不能为空！", "back", "Error", "null"
    End If
    If Easp.IsN(Content) Then
        CmsAdmin.JscriptMsg "自定义标签内容不能为空！", "back", "Error", "null"
    End If
    '=====================================================================
    Dim List, ResultVal
    Easp.Use "list"
    Set List = Easp.List.New
    List("Title") = Title
    List("Info") = Info
    List("Content") = Content
    List("AddTime") = Now()
    '=====================================================================
    ResultVal = Easp.db.AR(TablePrefix & "FreeTag:id", List.Hash)
    '=====================================================================
    Easp.C List
    If ResultVal <> 0 Then
        CmsAdmin.JscriptMsg "添加自定义标签成功！", "Admin.Tag.List.Asp", "Success", "null"
    End If
    '=====================================================================
End Sub
%>
