<!--#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/settpl.check.js"></script>
<form name="myform" id="myform" method="post" action="?action=savemain">
  <div class="navigation">控制面板 &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>
        <li><a onclick="tabs(this);" 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="PcIndexTemplate" id="PcIndexTemplate" datatype="*6-50" nullmsg="电脑端网站首页模版必须填写" errormsg="至少6个字符,最多50个字符!" autocomplete="off" readonly="readonly" value="<%=PcIndexTemplate%>" />
              <input type="button" value="清空" class="btnSearch" onclick="InnerVal('PcIndexTemplate', '');" />
              <input type="button" value="选择模版" class="btnSearch" onclick="ShowWin('PcIndexTemplate', '选择网站首页模版', '<%=CmsAdminMapPath%>tpl/Admin.Index.Asp?action=sf&ReturnId=PcIndexTemplate', SetDialog.SpecialWidth, SetDialog.SpecialHeight, false);" />
              <span class="Validform_checktip">*</span></td>
          </tr>
          <tr>
            <th> 电脑端留言首页模版： </th>
            <td class="td2"><input type="text" class="txtInput w350" name="PcBookIndexTemplate" id="PcBookIndexTemplate" datatype="*0-50" errormsg="最多50个字符!" autocomplete="off" readonly="readonly" value="<%=PcBookIndexTemplate%>" />
              <input type="button" value="清空" class="btnSearch" onclick="InnerVal('PcBookIndexTemplate', '');" />
              <input type="button" value="选择模版" class="btnSearch" onclick="ShowWin('PcBookIndexTemplate', '选择留言首页模版', '<%=CmsAdminMapPath%>tpl/Admin.Index.Asp?action=sf&ReturnId=PcBookIndexTemplate', SetDialog.SpecialWidth, SetDialog.SpecialHeight, false);" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 电脑端评论列表模版： </th>
            <td class="td2"><input type="text" class="txtInput w350" name="PcCommentListTemplate" id="PcCommentListTemplate" datatype="*0-50" errormsg="最多50个字符!" autocomplete="off" readonly="readonly" value="<%=PcCommentListTemplate%>" />
              <input type="button" value="清空" class="btnSearch" onclick="InnerVal('PcCommentListTemplate', '');" />
              <input type="button" value="选择模版" class="btnSearch" onclick="ShowWin('PcCommentListTemplate', '选择电脑端评论列表模版', '<%=CmsAdminMapPath%>tpl/Admin.Index.Asp?action=sf&ReturnId=PcCommentListTemplate', SetDialog.SpecialWidth, SetDialog.SpecialHeight, false);" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 电脑端网站Html地图模版： </th>
            <td class="td2"><input type="text" class="txtInput w350" name="PcSiteMapTemplate" id="PcSiteMapTemplate" datatype="*0-50" errormsg="最多50个字符!" autocomplete="off" readonly="readonly" value="<%=PcSiteMapTemplate%>" />
              <input type="button" value="清空" class="btnSearch" onclick="InnerVal('PcSiteMapTemplate', '');" />
              <input type="button" value="选择模版" class="btnSearch" onclick="ShowWin('PcSiteMapTemplate', '选择网站地图模版', '<%=CmsAdminMapPath%>tpl/Admin.Index.Asp?action=sf&ReturnId=PcSiteMapTemplate', SetDialog.SpecialWidth, SetDialog.SpecialHeight, false);" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 百度Xml地图模版： </th>
            <td class="td2"><input type="text" class="txtInput w350" name="BaiduMapTemplate" id="BaiduMapTemplate" datatype="*0-50" errormsg="最多50个字符!" autocomplete="off" readonly="readonly" value="<%=BaiduMapTemplate%>" />
              <input type="button" value="清空" class="btnSearch" onclick="InnerVal('BaiduMapTemplate', '');" />
              <input type="button" value="选择模版" class="btnSearch" onclick="ShowWin('BaiduMapTemplate', '选择百度地图模版', '<%=CmsAdminMapPath%>tpl/Admin.Index.Asp?action=sf&ReturnId=BaiduMapTemplate', SetDialog.SpecialWidth, SetDialog.SpecialHeight, false);" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 谷歌Xml地图模版： </th>
            <td class="td2"><input type="text" class="txtInput w350" name="GoogleMapTemplate" id="GoogleMapTemplate" datatype="*0-50" errormsg="最多50个字符!" autocomplete="off" readonly="readonly" value="<%=GoogleMapTemplate%>" />
              <input type="button" value="清空" class="btnSearch" onclick="InnerVal('GoogleMapTemplate', '');" />
              <input type="button" value="选择模版" class="btnSearch" onclick="ShowWin('GoogleMapTemplate', '选择谷歌地图模版', '<%=CmsAdminMapPath%>tpl/Admin.Index.Asp?action=sf&ReturnId=GoogleMapTemplate', SetDialog.SpecialWidth, SetDialog.SpecialHeight, false);" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> robots模版： </th>
            <td class="td2"><input type="text" class="txtInput w350" name="RobotsTemplate" id="RobotsTemplate" datatype="*0-50" errormsg="最多50个字符!" autocomplete="off" readonly="readonly" value="<%=RobotsTemplate%>" />
              <input type="button" value="清空" class="btnSearch" onclick="InnerVal('RobotsTemplate', '');" />
              <input type="button" value="选择模版" class="btnSearch" onclick="ShowWin('RobotsTemplate', '选择robots模版', '<%=CmsAdminMapPath%>tpl/Admin.Index.Asp?action=sf&ReturnId=RobotsTemplate', SetDialog.SpecialWidth, SetDialog.SpecialHeight, false);" />
              <span class="Validform_checktip"></span></td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="tab_con">
      <table class="form_table">
        <col width="200px">
          </col>
        
        <tbody>
          <tr>
            <th> 手机端网站首页模版： </th>
            <td class="td2"><input type="text" class="txtInput w350" name="MtIndexTemplate" id="MtIndexTemplate" datatype="*0-50" errormsg="最多50个字符!" autocomplete="off" readonly="readonly" value="<%=MtIndexTemplate%>" />
              <input type="button" value="清空" class="btnSearch" onclick="InnerVal('MtIndexTemplate', '');" />
              <input type="button" value="选择模版" class="btnSearch" onclick="ShowWin('MtIndexTemplate', '选择网站首页模版', '<%=CmsAdminMapPath%>tpl/Admin.Index.Asp?action=sf&ReturnId=MtIndexTemplate', SetDialog.SpecialWidth, SetDialog.SpecialHeight, false);" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 手机端留言首页模版： </th>
            <td class="td2"><input type="text" class="txtInput w350" name="MtBookIndexTemplate" id="MtBookIndexTemplate" datatype="*0-50" errormsg="最多50个字符!" autocomplete="off" readonly="readonly" value="<%=MtBookIndexTemplate%>" />
              <input type="button" value="清空" class="btnSearch" onclick="InnerVal('MtBookIndexTemplate', '');" />
              <input type="button" value="选择模版" class="btnSearch" onclick="ShowWin('MtBookIndexTemplate', '选择留言首页模版', '<%=CmsAdminMapPath%>tpl/Admin.Index.Asp?action=sf&ReturnId=MtBookIndexTemplate', SetDialog.SpecialWidth, SetDialog.SpecialHeight, false);" />
              <span class="Validform_checktip"></span></td>
          </tr>
          <tr>
            <th> 手机端网站Html地图模版： </th>
            <td class="td2"><input type="text" class="txtInput w350" name="MtSiteMapTemplate" id="MtSiteMapTemplate" datatype="*0-50" errormsg="最多50个字符!" autocomplete="off" readonly="readonly" value="<%=MtSiteMapTemplate%>" />
              <input type="button" value="清空" class="btnSearch" onclick="InnerVal('MtSiteMapTemplate', '');" />
              <input type="button" value="选择模版" class="btnSearch" onclick="ShowWin('MtSiteMapTemplate', '选择网站地图模版', '<%=CmsAdminMapPath%>tpl/Admin.Index.Asp?action=sf&ReturnId=MtSiteMapTemplate', SetDialog.SpecialWidth, SetDialog.SpecialHeight, false);" />
              <span class="Validform_checktip"></span></td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="foot_btn_box">
      <input type="submit" class="btnSubmit" value="提交保存" />
      &nbsp;
      <input name="重置" type="reset" class="btnSubmit" value="重 置" />
    </div>
  </div>
</form>
<%
End Sub

Sub SaveMain()
    ChkSysAdminLevel "sys_config", "edit"
    '=====================================================================
    Dim RqPcIndexTemplate, RqPcBookIndexTemplate, RqPcSiteMapTemplate
    Dim RqPcCommentListTemplate
    Dim RqBaiduMapTemplate, RqGoogleMapTemplate, RqRobotsTemplate
    Dim RqMtIndexTemplate, RqMtBookIndexTemplate, RqMtSiteMapTemplate
    '=====================================================================
    RqPcIndexTemplate = Trim(Easp.Post("PcIndexTemplate:s"))
    RqPcBookIndexTemplate = Trim(Easp.Post("PcBookIndexTemplate:s"))
    RqPcCommentListTemplate = Trim(Easp.Post("PcCommentListTemplate:s"))
    RqPcSiteMapTemplate = Trim(Easp.Post("PcSiteMapTemplate:s"))
    RqBaiduMapTemplate = Trim(Easp.Post("BaiduMapTemplate:s"))
    RqGoogleMapTemplate = Trim(Easp.Post("GoogleMapTemplate:s"))
    RqRobotsTemplate = Trim(Easp.Post("RobotsTemplate:s"))
    RqMtIndexTemplate = Trim(Easp.Post("MtIndexTemplate:s"))
    RqMtBookIndexTemplate = Trim(Easp.Post("MtBookIndexTemplate:s"))
    RqMtSiteMapTemplate = Trim(Easp.Post("MtSiteMapTemplate:s"))
    '=====================================================================
    If Easp.IsN(RqPcIndexTemplate) Then
        CmsAdmin.JscriptMsg "电脑端网站首页模版必须选择！", "back", "Error", "null"
    End If
    Dim Tpl
    Tpl = ""
    Tpl = Tpl & "<" & "%" & vbCrLf
    Tpl = Tpl & "'######################################################################" & vbCrLf
    Tpl = Tpl & "'## tpl.asp" & vbCrLf
    Tpl = Tpl & "'## -------------------------------------------------------------------" & vbCrLf
    Tpl = Tpl & "'## 网站生成模版配置文件" & vbCrLf
    Tpl = Tpl & "'######################################################################" & vbCrLf
    Tpl = Tpl & "Dim PcIndexTemplate" & vbCrLf
    Tpl = Tpl & "PcIndexTemplate = """& RqPcIndexTemplate &"""" & vbCrLf
    Tpl = Tpl & "" & vbCrLf
    Tpl = Tpl & "Dim PcBookIndexTemplate" & vbCrLf
    Tpl = Tpl & "PcBookIndexTemplate = """& RqPcBookIndexTemplate &"""" & vbCrLf
    Tpl = Tpl & "" & vbCrLf
    Tpl = Tpl & "Dim PcCommentListTemplate" & vbCrLf
    Tpl = Tpl & "PcCommentListTemplate = """& RqPcCommentListTemplate &"""" & vbCrLf
    Tpl = Tpl & "" & vbCrLf
    Tpl = Tpl & "Dim PcSiteMapTemplate" & vbCrLf
    Tpl = Tpl & "PcSiteMapTemplate = """& RqPcSiteMapTemplate &"""" & vbCrLf
    Tpl = Tpl & "" & vbCrLf
    Tpl = Tpl & "Dim BaiduMapTemplate" & vbCrLf
    Tpl = Tpl & "BaiduMapTemplate = """& RqBaiduMapTemplate &"""" & vbCrLf
    Tpl = Tpl & "" & vbCrLf
    Tpl = Tpl & "Dim GoogleMapTemplate" & vbCrLf
    Tpl = Tpl & "GoogleMapTemplate = """& RqGoogleMapTemplate &"""" & vbCrLf
    Tpl = Tpl & "" & vbCrLf
    Tpl = Tpl & "Dim RobotsTemplate" & vbCrLf
    Tpl = Tpl & "RobotsTemplate = """& RqRobotsTemplate &"""" & vbCrLf
    Tpl = Tpl & "" & vbCrLf
    Tpl = Tpl & "Dim MtIndexTemplate" & vbCrLf
    Tpl = Tpl & "MtIndexTemplate = """& RqMtIndexTemplate &"""" & vbCrLf
    Tpl = Tpl & "" & vbCrLf
    Tpl = Tpl & "Dim MtBookIndexTemplate" & vbCrLf
    Tpl = Tpl & "MtBookIndexTemplate = """& RqMtBookIndexTemplate &"""" & vbCrLf
    Tpl = Tpl & "" & vbCrLf
    Tpl = Tpl & "Dim MtSiteMapTemplate" & vbCrLf
    Tpl = Tpl & "MtSiteMapTemplate = """& RqMtSiteMapTemplate &"""" & vbCrLf
    Tpl = Tpl & "%" & ">" & vbCrLf
    Easp.Use "Fso"
    Easp.Fso.CreateFile SiteWebFilePath & "Inc/easp/tpl.asp", Tpl
    CmsAdmin.JscriptMsg "配置模板成功！", "Admin.Sys.Asp", "Success", "null"
    '=====================================================================
End Sub
%>
