<!--#include file="../fy.Function.asp"-->
<!--#include file="fy.M.ASP"-->
<!--#include file="../../editor/index.asp"-->
<!doctype html>
<html>
<head>
<meta charset="gb2312">
<title>模型管理</title>
<link rel="stylesheet" type="text/css" href="../css/base.css">
<link rel="stylesheet" type="text/css" href="../css/content.css">
<script type='text/javascript' src='../js/main.js'></script>
<script type="text/javascript" src="../../fy_inc/js/jquery.js"></script>
<script type='text/javascript' src='../../fy_inc/js/lhg/lhgdialog.min.js'></script>
</head>
<body>
<% 	Dim Action,ModeID,Rs,directory,MakeFolderDir,ContentExtension,AutoPage,admintemplatevalue,usertemplatevalue,umr,def
	Dim language,languager,languagedef,languagecontent,umrdef,ifxml,a
	ModeID = ChkNumeric(Request("ModeID"))
	umr = ChkNumeric(Request("umr"))
	def = ChkNumeric(Request("def"))
	umrdef = ChkNumeric(Request("umrdef"))
	
	languager= ChkNumeric(Request("languager"))
	language= ChkNumeric(Request("language"))
	languagedef= ChkNumeric(Request("languagedef"))
	ifxml= ChkNumeric(Request("ifxml"))
 	Action = Request.QueryString("A")
	 if ModeID=0 or ModeID="" Then ModeID=1%>
<div class="content"> 
	<div class="breadnav">当前位置：<a href="#">后台首页</a> >> 模型管理</div>
    <div class="opers">
		<a href="?A=Add"  class="btn <%If Action="Add" Or Action="E" Then echo " btn_primary" %>">添加/修改模型</a> 
		<a href="ModeList.asp?A=1" class="btn <%If Action="1" Then echo " btn_primary" %>">导出内容模型</a>
	    <a href="ModeList.asp?A=2" class="btn <%If Action="2" Then echo " btn_primary" %>">导入内容模型</a>


    </div>
<%

	Select Case Action
		   Case "AddSave","ESave"
		   		Call AddSave()
			Case "Add","E"
				Call AddEdit()
			Case Else
				Call Main()
	End Select
		IF Action = "Del" Then
	If Not fycms.ChkAdmin() Then  Call fycms.Alert("对不起，您没有操作权限！","")
	Dim rs1
		IF ModeID  > 1 Then
			Set rs1=fycms.actexe("select id,classid,modeid from class_fy where modeid="& ModeID)
			Do While Not rs1.eof
						Dim rsp
						Set rs = fycms.actexe("Select * From "&fycms.ACT_C(rs1("modeid"),2)&" Where ClassID =" & rs1("classid") & "")
						Do While Not rs.eof
									Set rsp = fycms.actexe("Select * from Upload_fy  Where aid=" & rs("id") & " and modeid="&rs1("modeid")&"")
										If Not  rsp.eof  Then
											Do While Not rsp.eof
											Call fycms.DeleteFile(Rsp("UpfileDir"))
											Conn.execute("Delete from Upload_fy  Where id= "&Rsp("id"))
											rsp.movenext
											loop
										End If 
									Dim Tmps,TmpUs 
									If Right(fycms.ACT_C(rs1("modeid"),10),1)<>"/" Then 
											Call fycms.DeleteFile(fycms.ActSys&fycms.ACT_C(rs1("modeid"),6)&rs("FileName")&fycms.ACT_C(rs1("modeid"),11))
									Else
											Call fycms.DeleteFile(fycms.ActSys&fycms.ACT_C(rs1("modeid"),6)&rs("FileName")&"/Index"&fycms.ACT_C(rs1("modeid"),11))
									End If 

									Conn.execute("Delete from Comment_fy  Where acticleID=" & rs("id") & " and ModeID="&rs1("modeid")&"")
									Conn.execute("Delete from Digg_fy  Where NewsID=" & rs("id") & " and modeid="&rs1("modeid")&"")
									Conn.execute("Delete from "&fycms.ACT_C(rs1("modeid"),2)&"  Where ID=" & rs("id") & "")
						rs.movenext
						loop

									Conn.execute("Delete from class_fy  Where ID=" & rs1("id") )

			rs1.movenext
			loop
			fycms.ACTEXE("Delete From Mode_fy Where ModeID=" & ModeID)	
 
			Call fycms.ActErr("删除模型成功","Mode/fy.MX.asp","")	
 		Else
		 	Call fycms.ActErr("系统定义的模型不允许删除","Mode/fy.MX.asp","1")	
 		End IF
	End IF
	
	
	Sub AddSave()
		 Dim ModeName,ModeTable,sql,ChannelRS,ChannelRSSql,ModeNote,ModeStatus,IFmake,RefreshFlag
		 Dim UpfilesDir,RecyleIF,CommentCode,Commentsize,WriteComment,CommentTemp
		 Dim usermb,adminmb,files,arrpath
		 ModeName = fycms.S("ModeName")
		 ModeTable = fycms.S("ModeTable")
		 ModeNote = fycms.S("ModeNote")
 		 usermb=ChkNumeric(fycms.S("usermb"))
		 adminmb=ChkNumeric(fycms.S("adminmb"))
		 ModeStatus = fycms.S("ModeStatus")
		 IFmake = fycms.S("IFmake")
		 languagecontent = fycms.S("languagecontent")
		 RefreshFlag = ChkNumeric(fycms.S("RefreshFlag"))
		 UpfilesDir = fycms.S("UpfilesDir")
		 RecyleIF = fycms.S("RecyleIF")
		 directory = fycms.S("directory")
		 MakeFolderDir = fycms.S("MakeFolderDir")
		 ContentExtension = fycms.S("ContentExtension")
 		 AutoPage = ChkNumeric(fycms.S("AutoPage"))
		 CommentCode = ChkNumeric(fycms.S("CommentCode"))
		 Commentsize = ChkNumeric(fycms.S("Commentsize"))
		 WriteComment = ChkNumeric(fycms.S("WriteComment"))
 
		 
		 CommentTemp = fycms.S("CommentTemp")
 		 Call fycms.CreateFolder(fycms.actsys&"fy_inc/cache/"&ModeID&"/")
	
		 
		 If adminmb="1" Then 
 			admintemplatevalue=	fycms.FFile(request.form("admintemplatevalue"),fycms.actsys&"fy_inc/cache/"&ModeID&"/"&fycms.ACT_C(ModeID,2)&"-mode.inc")
		 End If 

		
		 If usermb="1" Then 
 			usertemplatevalue=	fycms.FFile(request.form("usertemplatevalue"),fycms.actsys&"fy_inc/cache/"&ModeID&"/"&fycms.ACT_C(ModeID,2)&"-usermode.inc")
		 End If 



		 IF fycms.S("ModeName") = "" Then
		 	Call fycms.Alert("模型名称不能为空!",""):Exit Sub
		 End If
		 IF fycms.S("directory") = "" Then
		 	Call fycms.Alert("内容目录不能为空!",""):Exit Sub
		 End If
		 
	 
		files=fycms.getfilepath(delAsp(directory),3)
		Call fycms.CreateFolder(fycms.getfilepath(delAsp(directory),0))

		If left(files,1)="/" Then 
			files="fycms101aae08dd2ea51b0c370a1241e9793d"&files
			If fycms.actsys="/" Then 
 				files=rep(files,"fycms101aae08dd2ea51b0c370a1241e9793d/","")
			Else 

				files=rep(files,"fycms101aae08dd2ea51b0c370a1241e9793d"&fycms.actsys,"")
 			End If 
		End if
 		plustemplate=LTemplate("art.txt")

		

		If left(files,1)="/" Then 
		files="/"&files
		files=rep(files,"//","")
		End If 
		arrpath=Split(files,"/")

		If ubound(arrpath)<=1 Then 
			If  ubound(arrpath)=1 Then 
				plustemplate=rep(plustemplate,"{nextpath}","../")
			Else 
				plustemplate=rep(plustemplate,"{nextpath}","")
			End If 
		Else 
			For ii=1 To ubound(arrpath)
				Nextpath=Nextpath&"../"
			Next 
			plustemplate=rep(plustemplate,"{nextpath}",Nextpath)
		End If 



 
		 Set ChannelRS = Server.CreateObject("adodb.recordset")
		 if Action="AddSave" Then
			 If Not fycms.ChkAdmin() Then   Call fycms.Alert("对不起，您没有操作权限！","")
			 IF fycms.S("ModeTable") = "" Then
				Call fycms.Alert("数据表为空!",""):Exit Sub
			 End If
			 
			If fycms.defaultField(ModeName,"")=True Then  Call fycms.Alert("数据库中已存在该字段\n或该字段是系统关键字!", "")

			 If Not fycms.ACTEXE("SELECT ModeName FROM Mode_fy Where ModeName='" & ModeName & "' order by ModeID desc").eof Then
				Call fycms.Alert("系统已存在该模型名称!",""):Exit Sub
			 End if	

			 If Not fycms.ACTEXE("SELECT ModeTable FROM Mode_fy Where ModeTable='" & ModeTable & "' order by ModeID desc").eof Then
				Call fycms.Alert("系统已存在该数据表!",""):Exit Sub
			 End if	


			 If Not fycms.ACTEXE("SELECT ModeTable FROM Mode_fy Where directory='" & directory & "' order by ModeID desc").eof Then
				Call fycms.Alert("系统已存在该内容目录!",""):Exit Sub
			 End if	


			  ChannelRSSql = "select * from Mode_fy"
			  ChannelRS.Open ChannelRSSql, Conn, 1, 3
			  ChannelRS.AddNew
		 	  ChannelRS("ModeTable") = ModeTable
			  ChannelRS("ModeName") = ModeName
			  ChannelRS("ModeNote") = ModeNote
			  ChannelRS("ModeStatus") = ModeStatus
			  ChannelRS("IFmake") = IFmake
			  ChannelRS("RecyleIF") = RecyleIF
			  ChannelRS("AutoPage") = AutoPage
			  ChannelRS("UpfilesDir") = UpfilesDir
			  ChannelRS("directory") = files
			  ChannelRS("MakeFolderDir") = MakeFolderDir
			  ChannelRS("ContentExtension") = ContentExtension
			  ChannelRS("RefreshFlag") = RefreshFlag
			  ChannelRS("CommentCode") = CommentCode
			  ChannelRS("Commentsize") = Commentsize
			  ChannelRS("WriteComment") = WriteComment
			  ChannelRS("CommentTemp") = CommentTemp
  			  ChannelRS("usermb")=usermb
			  ChannelRS("adminmb")=adminmb
			  ChannelRS("ifxml")=ifxml
			  ChannelRS("languagecontent")=languagecontent
			  ChannelRS("ACT_DiY")="§0§0-1-0-1§0§§0§§0§§0§§0§Simple§§§0§0§0§0§1-1-200-1§0§0§栏目首页.html§列表分页.html§内容详细页.html§0§§0§§0§§0§1§0§§1§§0§§0§0§0§内容详细页.html§0§§§§"
			  ChannelRS.Update
			  ChannelRS.Close:Set ChannelRS = Nothing			
				 Dim sqlformat:If  DataBaseType="access" Then sqlformat=" CONSTRAINT PrimaryKey PRIMARY KEY"
 				 Sql="CREATE TABLE "&ModeTable&" ([ID] int IDENTITY (1, 1) NOT NULL "&sqlformat&" ,"&_
				"ClassID int Default 0,"&_
				"Title varchar(250),"&_
				"IntactTitle varchar(250),"&_
				"ActLink tinyint,"&_
 				"Intro text,"&_
				"Content text,"&_
				"allpic text,"&_
				"Hits int Default 0,"&_
				"rev tinyint Default 0,"&_
				"ChargeType tinyint Default 0,"&_
				"InfoPurview tinyint Default 0,"&_
				"arrGroupID varchar(250),"&_
				"pinyin varchar(250),"&_
				"ReadPoint  int Default 0,"&_
				"PitchTime  int Default 0,"&_
				"ReadTimes  int Default 0,"&_
				"DividePercent  int Default 0,"&_
				"KeyWords varchar(200),"&_
				"description varchar(200),"&_
  				"CopyFrom varchar(250),"&_
				"addtime datetime,"&_
				"UpTime datetime,"&_
				"publishtime datetime,"&_
				"TemplateUrl varchar(100),"&_
				"FileName varchar(200),"&_
				"isAccept tinyint,"&_
				"delif tinyint Default 0,"&_
				"UserID  int Default 0,"&_
				"ArticleInput varchar(250),"&_
				"Author varchar(250),"&_
				"Slide tinyint Default 0,"&_
				"PicUrl varchar(200),"&_
				"UserIP varchar(200),"&_
				"upIP varchar(200),"&_
				"Ismake tinyint,"&_
				"Digg int Default 0,"&_
				"down int Default 0,"&_
				"ATT SmallInt Default 0,"&_
				"OrderID int Default 10,"&_
				"commentscount int Default 0,"&_
				"IStop tinyint Default 0"&_
				")"
			fycms.ACTEXE(sql)
			Application.Contents.RemoveAll

			Set rs=fycms.actexe("Select top 1 ModeID from Mode_fy order by ModeID desc")
			If Not rs.eof Then ModeID = rs("ModeID")

			fycms.actexe("insert Into DiyMenu_fy(MenuName,MenuUrl,OpenWay,AdminID) values('<font color=green>添加"&ModeName&"</font>','fy_Mode/fy.Add.asp?ModeID="&ModeID&"','ifrcontent','1')")


 
		If IFmake=0 Then 
			rewriteurl="""""&fycms.acturl&"""&fycms.getfilepath(delAsp(directory),3)&"?id="" & ID & ""&page="""
		Else 
 			execute("contentrewriteurl=Content"&modeid&"_rewrite_url")
			If Instr(contentrewriteurl,"{id}") > 0 Then contentrewriteurl = Replace(contentrewriteurl,"{id}","""&id")
			If Instr(contentrewriteurl,"{classid}") > 0 Then contentrewriteurl = Replace(contentrewriteurl,"{classid}","""&id")
			If Instr(contentrewriteurl,"{modeid}") > 0 Then contentrewriteurl = Replace(contentrewriteurl,"{modeid}","""&id")
			If Instr(contentrewriteurl,"{pinyinnum}") > 0 Then contentrewriteurl = Replace(contentrewriteurl,"{pinyinnum}","""&id")
			 rewriteurl="""""&fycms.acturl&"""&fycms.getfilepath(delAsp(directory),3)&"?id="" & ID & ""&page="""
		End If 

		plustemplate=rep(plustemplate,"{modeid}",modeid)
		plustemplate=rep(plustemplate,"{rewriteurl}",rewriteurl)

			If fycms.ACT_C(modeid,18)="1" Then
				 plustemplate=rep(plustemplate,"{getcontent}","TypeContent=fycms.Htmljapan(fycms.HTMLCode(getcontentxml(modeid,id,rs(""addtime""))))")
			Else 
				plustemplate=rep(plustemplate,"{getcontent}","If RS(""Content"") <> """" Then TypeContent=fycms.Htmljapan(RS(""Content""))")
			End If 



 		Call noSaveFile(plustemplate,fycms.actsys&files)

 

			Call fycms.ActErr("添加成功","Mode/fy.MX.asp","")
 		 Else
			If Not fycms.fycms_QXYZ(ModeID,"","") Then   Call fycms.Alert("对不起，您没有"&fycms.ACT_C(ModeID,1)&"系统该项操作权限！","")
				If Not fycms.ACTEXE("SELECT ModeName FROM Mode_fy Where ModeID <>" & ModeID & " AND  ModeName='" & ModeName & "' order by ModeID desc").eof Then
					Call fycms.Alert("系统已存在该模型名称!",""):Exit Sub
				 End if	

				If Not fycms.ACTEXE("SELECT ModeName FROM Mode_fy Where ModeID <>" & ModeID & " AND  directory='" & directory & "' order by ModeID desc").eof Then
					Call fycms.Alert("系统已存在该内容目录!",""):Exit Sub
				 End if	


				  ChannelRSSql = "select * from Mode_fy Where ModeID=" &ModeID
				  ChannelRS.Open ChannelRSSql, Conn, 1, 3
				  if ChannelRS.eof then Call fycms.Alert("错误!",""):Exit Sub
			 End if 
			
			 If ChkNumeric(fycms.S("adminmb"))="1" Then 
				Call fycms.FFile(request.form("admintemplatevalue"),fycms.actsys&"fy_inc/cache/"&ModeID&"/"&fycms.ACT_C(ModeID,2)&"-mode.inc")
			 End If 
		
 

		 If usermb="1" Then 
 			usertemplatevalue=	fycms.FFile(request.form("usertemplatevalue"),fycms.actsys&"fy_inc/cache/"&ModeID&"/"&fycms.ACT_C(ModeID,2)&"-usermode.inc")
		 End If 
  		  ChannelRS("ModeName") = ModeName
		  ChannelRS("ModeNote") = ModeNote
		  ChannelRS("ModeStatus") = ModeStatus
		  ChannelRS("IFmake") = IFmake
		  ChannelRS("RecyleIF") = RecyleIF
		  ChannelRS("UpfilesDir") = UpfilesDir
		  ChannelRS("directory") = files
		  ChannelRS("MakeFolderDir") = MakeFolderDir
		  ChannelRS("ContentExtension") = ContentExtension
		  ChannelRS("AutoPage") = AutoPage
		  ChannelRS("RefreshFlag") = RefreshFlag
		  ChannelRS("CommentCode") = CommentCode
		  ChannelRS("Commentsize") = Commentsize
		  ChannelRS("WriteComment") = WriteComment
		  ChannelRS("CommentTemp") = CommentTemp
 		  ChannelRS("usermb")=usermb
		  ChannelRS("adminmb")=adminmb
		  ChannelRS("ifxml")=ifxml
		  
		  ChannelRS("languagecontent")=languagecontent
 		  ChannelRS.Update
		  ChannelRS.Close:Set ChannelRS = Nothing	
		  Application.Contents.RemoveAll
		Dim plustemplate,rewriteurl
 
		If IFmake=0 Then 
			 rewriteurl="""""&fycms.acturl&"""&fycms.getfilepath(delAsp(directory),3)&"?id="" & ID & ""&page="""
			'rewriteurl="""""&fycms.domain&fycms.act_c(ModeID,5)&"&"""?id=""&id&""&page="""
		Else 
			Dim contentrewriteurl
			execute("contentrewriteurl=Content"&modeid&"_rewrite_url")
			If Instr(contentrewriteurl,"{id}") > 0 Then contentrewriteurl = Replace(contentrewriteurl,"{id}","""&id")
			If Instr(contentrewriteurl,"{classid}") > 0 Then contentrewriteurl = Replace(contentrewriteurl,"{classid}","""&id")
			If Instr(contentrewriteurl,"{modeid}") > 0 Then contentrewriteurl = Replace(contentrewriteurl,"{modeid}","""&id")
			If Instr(contentrewriteurl,"{pinyinnum}") > 0 Then contentrewriteurl = Replace(contentrewriteurl,"{pinyinnum}","""&id")
		rewriteurl="""""&fycms.acturl&"""&fycms.getfilepath(delAsp(directory),3)&"?id="" & ID & ""&page="""
		End If 

		plustemplate=rep(plustemplate,"{modeid}",modeid)
		plustemplate=rep(plustemplate,"{rewriteurl}",rewriteurl)

			If fycms.ACT_C(modeid,18)="1" Then
				 plustemplate=rep(plustemplate,"{getcontent}","TypeContent=fycms.Htmljapan(fycms.HTMLCode(getcontentxml(modeid,id,rs(""addtime""))))")
			Else 
				plustemplate=rep(plustemplate,"{getcontent}","If RS(""Content"") <> """" Then TypeContent=fycms.Htmljapan(RS(""Content""))")
			End If 

		
 		Call noSaveFile(plustemplate,fycms.actsys&files)
 		Call noSaveFile("by www.fycms.com",fycms.ActSys&"data/"&ModeID&"/index.html")
 
  		   Call fycms.ActErr("修改成功&nbsp;&nbsp;<a href=Mode/fy.MX.asp>点击这里返回管理首页</a>","Mode/fy.MX.asp","")
	End Sub
	
%>
<%Sub Main()%>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <thead>
      <tr>
    <th>模型ID</th>
    <th>模型名称</th>
    <th>表名</th>
    <th>描述</th>
    <th>状态</th>
	<th>生成Html</th>
    <th>操作</th>
	  
	  </tr>
    </thead>
   <% 
	  Set Rs =fycms.ACTEXE("SELECT ModeID, ModeName,ModeTable, ModeStatus, IFmake,ModeNote  FROM Mode_fy order by ModeID asc")
	 If Rs.EOF  Then
	 	echo	"<tr><td colspan=""6"" align=""center"">没有记录</td></tr>"
	 Else
		Do While Not Rs.EOF	
	 %><tr>

    <td><%= Rs("ModeID") %></td>
    <td><%= Rs("ModeName") %></td>
    <td><%= Rs("ModeTable") %></td>
    <td><%= Rs("ModeNote") %></td>
    <td><% IF Rs("ModeStatus") = 0 Then echo "<font color=green>正常</font>" else  echo "<font color=red>禁用</font>" %></td>
    <td>
	<% Select Case  Rs("IFmake")
		Case "0" 
			echo "<font color=red>不生成(动态浏览) </font>" 
		Case "1" 
			echo "<font color=green>生成(静态)</font>"
		Case "2"
			echo "<font color=green>伪静态</font>"
	  End Select 
	%>
	</td>
	<td>
	<a href="fy.DiY.asp?ModeID=<%=Rs("ModeID")%>">自定义显示</a> ┆ <a href="fy.ListM.ASP?A=L&ModeID=<%=Rs("ModeID")  %>">字段列表</a> ┆ <a href="?A=E&ModeID=<%=Rs("ModeID")  %>" >修改</a> ┆ <a href="?A=Del&ModeID=<%=Rs("ModeID")  %>"  onClick="{if(confirm('确定删除该模型吗,注意!!!删除模型同时会删除该模型下的所有栏目和文章,如果文章比较多,可以先删除文章,然后再删除模型')){return true;}return false;}">删除</a></td>
  <% 
		
		Rs.movenext
		Loop
	End if	 %>

      </tr>
    </table>
   


<% 	
 
	End Sub
	Sub AddEdit()
		Dim ModeTable,ModeName,IFmake,RecyleIF,UpfilesDir,ModeStatus,RefreshFlag,ModeNote,A,WriteComment,CommentCode,Commentsize
		Dim CommentTemp,usermb,adminmb
		if Action="Add" Then
		UpfilesDir="UpFiles/"
		AutoPage=0
		A="AddSave"
		ContentExtension=".html"
		WriteComment=3
		CommentCode=0
		Commentsize=0
		MakeFolderDir="html/"
		CommentTemp="plus/Comment.html"
		languagecontent=LTemplate(fycms.actsys&"fy_inc/lan.txt")
		RefreshFlag=2
		Else
		Set Rs=server.CreateObject("adodb.recordset") 
		Rs.OPen "Select * from Mode_fy Where ModeID = "&ModeID&" order by ModeID desc",Conn,1,1
		ModeTable = Rs("ModeTable")
		ModeName = Rs("ModeName")
		IFmake = Rs("IFmake")
		RecyleIF = Rs("RecyleIF")
		UpfilesDir=Rs("UpfilesDir")
		ModeStatus=Rs("ModeStatus")
		RefreshFlag=Rs("RefreshFlag")
		ModeNote=Rs("ModeNote")
		directory=Rs("directory")
		MakeFolderDir=Rs("MakeFolderDir")
		ContentExtension=Rs("ContentExtension")
		AutoPage=Rs("AutoPage")
		WriteComment=Rs("WriteComment")
		CommentCode=Rs("CommentCode")
		Commentsize=Rs("Commentsize")
		CommentTemp=Rs("CommentTemp")
		 usermb=Rs("usermb")
		adminmb=Rs("adminmb")
		ifxml=Rs("ifxml")
		
		If adminmb="1" Then 
			admintemplatevalue=Server.HTMLEncode(LTemplate(fycms.ACTSYS&"fy_inc/cache/"&ModeID&"/"&fycms.ACT_C(ModeID,2)&"-mode.inc"))
		End If 
		
		If usermb="1" Then 
			usertemplatevalue=Server.HTMLEncode(LTemplate(fycms.ACTSYS&"fy_inc/cache/"&ModeID&"/"&fycms.ACT_C(ModeID,2)&"-usermode.inc"))
		End If 
		If request("def")="1" Then 
				admintemplatevalue=Server.HTMLEncode(M.ACT_NoRormMXList(ModeID))
				adminmb=1
		End If 

		If adminmb=1 Then def=1
		If usermb=1 Then umrdef=1
		If language=1 Then languagedef=1
		If request("umr")="1" Then 
				usertemplatevalue=Server.HTMLEncode(M.ACTUser_MXList(ModeID))
				usermb=1
		End If 
		If rs("languagecontent")<>"" Then 
				languagecontent=rs("languagecontent")
				languagedef=1
				language=1
		Else 
			languagecontent=LTemplate(fycms.actsys&"fy_inc/lan.txt")
		End If 
		A="ESave"
	end If%>
<form id="form1" name="form1" method="post" action="?A=<%= A %>&ModeID=<%= Request.QueryString("ModeID") %>">
    <div class="divtable"> 
        <dl>
            <dt>模型状态：</dt>
            <dd>
                <input <% IF ModeStatus = 0 Then echo "Checked" %> id="ModeStatus1" type="radio" name="ModeStatus" value="0" />
     <label for="ModeStatus1"><font color=green> 正常 </font></label>
       <input <% IF ModeStatus = 1 Then echo "Checked" %>  id="ModeStatus2" type="radio" name="ModeStatus" value="1" /><label for="ModeStatus2"><font color=red> 关闭 </font></label>  
            </dd>
         </dl>
        
        <dl>
            <dt>模型名称：</dt>
            <dd>
               <input name="ModeName" type="text" class="tinput"  id="ModeName" value="<%=ModeName %>" />
	  <font color="#ff0066">*</font>
            </dd>
         </dl>
        <dl>
            <dt>数据表名称：</dt>
            <dd>
               <input <% if A="ESave" then echo "disabled" %> name="ModeTable" type="text" class="tinput"  id="ModeTable" value="<%= ModeTable %>" />
        <font color="#ff0066">*</font>
            </dd>
         </dl>
        <dl>
            <dt>访问路径：</dt>
            <dd>
               <input name="directory" type="text" class="tinput"  id="directory" value="<%= directory %>" size="30" maxlength="250" />
       访问路径<font color="#ff0066">*</font> 如 art/index.asp 或者art.asp(根目录会生成art.asp文件),注意生成的文件不要覆盖已有的asp文件
            </dd>
         </dl>
        <dl>
            <dt>模型描述：</dt>
            <dd>
               <input name="ModeNote" type="text" class="tinput"  id="ModeNote" value="<%= ModeNote %>" size="40" maxlength="250" />
       简单的描述.不能超过250个字符
            </dd>
         </dl>
        <dl>
            <dt>文件生成存放目录：</dt>
            <dd>
               <input name="MakeFolderDir" type="text" class="tinput"  id="MakeFolderDir" value="<%= MakeFolderDir %>" size="40" maxlength="250" /> 不能以 / 开始,留空也可以
            </dd>
         </dl>
        <dl>
            <dt>是否生成HTML：</dt>
            <dd>
                 <input <% IF IFmake = 1 Then echo "Checked" %> id="IFmake1" type="radio" name="IFmake" value="1"  />
        <label for="IFmake1">生成(静态)</label>
	  <input <% IF IFmake = 0 Then echo "Checked" %> id="IFmake2" type="radio" name="IFmake" value="0"  /><label for="IFmake2">不生成(动态浏览)</label>	  
	
	    <input <% IF IFmake = 2 Then echo "Checked" %> id="IFmake3" type="radio" name="IFmake" value="2"  />
		    <label for="IFmake3"><font color=green>伪静态(需要服务器支持)</font></label>
      <a href="http://sighttp.qq.com/authd?IDKEY=dc9d9487c8c797974fec7124ec2248094ab916ca5fbed43c/" target="_blank"><font color="red">fycms官方伪静态空间</font></a>
            </dd>
         </dl>
        <dl>
            <dt>内容存储方式：</dt>
            <dd>
               <input  <% IF ifxml = 0 Then echo "Checked" %> id="ifxml1" type="radio" name="ifxml" value="0">
        <label for="ifxml1"><font color=green>数据库</font></label>
      <input  <% IF ifxml = 1 Then echo "Checked" %> id="ifxml2"  type="radio" name="ifxml" value="1"> 
     <label for="ifxml2"><font color=red>文件方式存储(不支持内容搜索)</font></label>

            </dd>
         </dl>
        <dl>
            <dt>自动分页：</dt>
            <dd>
               <input name="AutoPage" type="text" class="tinput"  id="AutoPage" value="<%= AutoPage %>" size="30">
	  为0则不设置自动分页
            </dd>
         </dl>
        <dl>
            <dt>删除文章：</dt>
            <dd>
                 <input  <% IF RecyleIF = 0 Then echo "Checked" %> id="RecyleIF1" type="radio" name="RecyleIF" value="0">
        <label for="RecyleIF1">放入回收站</label>
      <input  <% IF RecyleIF = 1 Then echo "Checked" %> id="RecyleIF2"  type="radio" name="RecyleIF" value="1"> 
     <label for="RecyleIF2">彻底删除</label>
            </dd>
         </dl>
        <dl>
            <dt>后台文件上传目录：</dt>
            <dd>
               <input name="UpfilesDir" type="text" class="tinput"  id="UpfilesDir" value="<%= UpfilesDir %>" size="30">
            </dd>
         </dl>
        <dl>
            <dt>内容文件扩展名：</dt>
            <dd>
               <input name="ContentExtension" type="text" class="tinput"  id="ContentExtension" value="<%= ContentExtension %>" size="50">
            </dd>
         </dl>
        <dl>
            <dt>后台添加文章，同时发布选项:</dt>
            <dd>
               <input id="RefreshFlag1" <% IF RefreshFlag = 1 Then echo "Checked" %> type="radio" name="RefreshFlag" value="1" >
 <label for="RefreshFlag1">仅发布内容页</label> 
  <input id="RefreshFlag2"  <% IF RefreshFlag = 2 Then echo "Checked" %> type="radio" name="RefreshFlag" value="2" >
  <label for="RefreshFlag2">发布栏目页+内容页+首页</label> 
  <input id="RefreshFlag3"  <% IF RefreshFlag = 3 Then echo "Checked" %> type="radio" name="RefreshFlag" value="3" >
  <label for="RefreshFlag3">发布首页+内容页</label>
            </dd>
         </dl>
        <dl>
            <dt>评论选项：</dt>
            <dd>
               <input <% IF WriteComment = 0 Then echo "Checked" %>  type="radio" value="0" name="WriteComment" id="WriteComment1" />
<label for="WriteComment1"><font color="red">关闭本模型的所有信息评论</font></label><br />
<input <% IF WriteComment = 1 Then echo "Checked" %>  type="radio" value="1" name="WriteComment" id="WriteComment2"  />
<label for="WriteComment2">本模型只允许<font color="green">会员</font>评论，且评论内容需要后台的审核</label>
<br />
<input <% IF WriteComment = 2 Then echo "Checked" %>  type="radio" value="2" name="WriteComment" id="WriteComment3"  />
<label for="WriteComment3">本模型只允许<font color="green">会员</font>评论，且评论内容不需要后台审核</label>
<br />
<input <% IF WriteComment = 3 Then echo "Checked" %>  type="radio" value="3" name="WriteComment" id="WriteComment4"  />
<label for="WriteComment4">本模型允许<font color="green">会员</font>，<font color="red">游客</font>评论，且评论内容需要后台审核</label>
<br />
<input <% IF WriteComment = 4 Then echo "Checked" %>  type="radio" value="4" name="WriteComment" id="WriteComment5"  />
<label for="WriteComment5">本模型允许<font color="green">会员</font>，<font color="red">游客</font>评论，且评论内容不需要后台审核<br>
</label>
            </dd>
         </dl>
        <dl>
            <dt>评论需要验证码：</dt>
            <dd>
               <INPUT <% IF CommentCode = 0 Then echo "Checked" %>   type="radio"  value="0" name="CommentCode" id="CommentCode1">
<label for="CommentCode1">是</label>
<INPUT <% IF CommentCode = 1 Then echo "Checked" %>  type="radio" value="1" name="CommentCode" id="CommentCode2">
<label for="CommentCode2">否</label>
            </dd>
         </dl>
        <dl>
            <dt>评论字数控制：</dt>
            <dd>
               <input name="Commentsize" type="text" class="tinput"  id="Commentsize" value="<%=Commentsize%>" size="8" maxlength="5"> 
	不限制请输入&quot;0&quot; 
            </dd>
         </dl>
        <dl>
            <dt>评论页模板：</dt>
            <dd>
               <input name="CommentTemp" type="text" class="tinput"  id="CommentTemp" value="<%=CommentTemp%>" size="40" maxlength="59"> 
<input id="PicUrls3" class="btn btn_primary" onClick="javascript:stemp('<%=fycms.actsys&fycms.adminurl%>/include/TempLate/Select.asp?ShowPath=<%=fycms.ThisTheme%>&iname=CommentTemp');" name="button" type="button"   value="选择模板">
            </dd>
         </dl>
        <dl>
            <dt>后台录入表单模板：</dt>
            <dd>
                <input <% IF adminmb = 0 Then echo "Checked" %> id="adminmb1" type="radio" name="adminmb" value="0"  onclick="adminmbq(0)"  />
        <label for="adminmb1">自动录入表单</label>
        <input  <% IF adminmb = 1 Then echo "Checked" %> id="adminmb2"  type="radio" name="adminmb" value="1"  onclick="adminmbq(1)"  />
        <label for="adminmb2">手动录入表单</label>
		&nbsp; <span id="amr"><a href="?A=E&ModeID=<%= Request.QueryString("ModeID") %>&def=1&umr=<%=request("umr")%>">载入默认</a></span>
            </dd>
         </dl>
        <dl id="adminmbs" <%If adminmb=0 Then echo "style=""DISPLAY: none"""%>>
            <dt></dt>
            <dd>
                 <textarea name="admintemplatevalue" style="width:98%" rows="10" cols="50"><%=admintemplatevalue%></textarea>
            </dd>
         </dl>
        <dl>
            <dt>前台投稿表单模板：</dt>
            <dd>
                 <input <% IF usermb = 0 Then echo "Checked" %> id="usermb1" type="radio" name="usermb" value="0"  onclick="usermbq(0)"  />
        <label for="usermb1">自动录入表单</label>

        <input  <% IF usermb = 1 Then echo "Checked" %> id="usermb2"  type="radio" name="usermb" value="1"  onclick="usermbq(1)"  />
        <label for="usermb2">手动录入表单</label>
		 
		&nbsp;<span id="umr"><a href="?A=E&ModeID=<%= Request.QueryString("ModeID") %>&umr=1&umrdef=<%=request("umrdef")%>">载入默认</a></span>
            </dd>
         </dl>
        <dl id="usermbs" <%If usermb=0 Then echo "style=""DISPLAY: none"""%>>
            <dt></dt>
            <dd>
                <textarea name="usertemplatevalue" style="width:98%" rows="10" cols="50"><%=usertemplatevalue%></textarea>
            </dd>
         </dl>
        <dl>
            <dt>语言包：<br />注意.翻译的名称不能带有 = 符号</dt>
            <dd>
                 <textarea name="languagecontent" rows="10" cols="50"><%=languagecontent%></textarea>	
            </dd>
         </dl>
             <dl>
            <dt class="vhid">提交：</dt>
            <dd>
                <a class="btn btn_primary" href="javascript:void(0);" onClick="CheckForm()">提交</a>
                <a class="btn" href="javascript:void(0);" onClick="CheckForm()">重置</a>
            </dd>
         </dl>
        
    </div>
    </form>


<script language="JavaScript" type="text/javascript">
		function adminmbq(q)
				{ if (q==0)
				  {
					 adminmbs.style.display="none";
					 amr.style.display="none";
				  }
				  else
					{
			    	adminmbs.style.display="";
			    	amr.style.display="";

					 }
				}

		function usermbq(q)
				{ if (q==0)
				  {
					 usermbs.style.display="none";
					 umr.style.display="none";
 				  }
				  else
					{
			    	usermbs.style.display="";
			    	umr.style.display="";

					 }
				}

 
		function languageq(q)
				{ if (q==0)
				  {
					  languages.style.display="none";
					 languager.style.display="none";
 				  }
				  else
					{
			    	languages.style.display="";
			    	languager.style.display="";

					 }
				}
				
function CheckForm()
{ var form=document.form1;
	
	 if (form.ModeName.value=='')
		{ alert("请输入模型名称!");   
		  form.ModeName.focus();    
		   return false;
		} 
	 if (form.ModeTable.value=='')
		{ alert("请输入数据表名称!");   
		  form.ModeTable.focus();    
		   return false;
		} 	 
	    form.submit();
        return true;
	}


</script>
<script language="javascript">usermbq(<%=umrdef%>);</script>
<script language="javascript">adminmbq(<%=def%>);</script>









	<%end sub
  %>




</div>
</body>
</html>
