' 显示调用错误提示
Sub ShowErr(str)
Call DBConnEnd()
Response.Write "调用错误:" & str
Response.End
End Sub
' 初始化输入参数
Sub InitPara()
' 取全屏标志
sFullScreen = Trim(Request.QueryString("fullscreen"))
' 取对应的内容ID
sContentID = Trim(Request.QueryString("id"))
If sContentID = "" Then ShowErr "请传入调用参数ID,即隐藏的内容表单项ID!"
' 取样式初始值
sStyleName = Trim(Request.QueryString("style"))
If sStyleName = "" Then sStyleName = "standard"
sSql = "select * from ewebeditor_style where s_name='" & sStyleName & "'"
oRs.Open sSql, oConn, 0, 1
If Not oRs.Eof Then
sStyleID = oRs("S_ID")
sStyleName = oRs("S_Name")
sStyleDir = oRs("S_Dir")
sStyleCSS = oRs("S_CSS")
sStyleUploadDir = oRs("S_UploadDir")
nStateFlag = oRs("S_StateFlag")
sDetectFromWord = oRs("S_DetectFromWord")
sInitMode = oRs("S_InitMode")
sBaseUrl = oRs("S_BaseUrl")
Else
ShowErr "无效的样式Style参数传入,如果要使用默认值,请留空!"
End If
oRs.Close
' 取版本号及发布日期
sSql = "select sys_version,sys_releasedate from ewebeditor_system"
oRs.Open sSql, oConn, 0, 1
sVersion = oRs(0)
sReleaseDate = oRs(1)
oRs.Close
End Sub
' 初始化按钮数组
Sub InitButtonArray()
Dim i
sSql = "select * from ewebeditor_button order by b_order asc"
oRs.Open sSql, oConn, 0, 1
i = 0
Do While Not oRs.Eof
i = i + 1
Redim Preserve aButtonCode(i)
Redim Preserve aButtonHTML(i)
aButtonCode(i) = oRs("B_Code")
Select Case oRs("B_Type")
Case 0
aButtonHTML(i) = "<DIV CLASS=""" & oRs("B_Class") & """ TITLE=""" & oRs("B_Title") & """ onclick=""" & oRs("B_Event") & """><IMG CLASS=""Ico"" SRC=""buttonimage/" & sStyleDir & "/" & oRs("B_Image") & """></DIV>"
Case 1
aButtonHTML(i) = "<SELECT CLASS=""" & oRs("B_Class") & """ onchange=""" & oRs("B_Event") & """>" & oRs("B_HTML") & "</SELECT>"
Case 2
aButtonHTML(i) = "<DIV CLASS=""" & oRs("B_Class") & """>" & oRs("B_HTML") & "</DIV>"
End Select
oRs.MoveNext
Loop
oRs.Close
End Sub
' 由按钮代码得到按钮的最终输出
Function Code2HTML(s_Code)
Dim i
Code2HTML = ""
For i = 1 To UBound(aButtonCode)
If UCase(aButtonCode(i)) = UCase(s_Code) Then
Code2HTML = aButtonHTML(i)
Exit Function
End If
Next
End Function
' 初始化工具栏
Sub InitToolBar()
Dim aButton, n
sSql = "select t_button from ewebeditor_toolbar where s_id=" & sStyleID & " order by t_order asc"
oRs.Open sSql, oConn, 0, 1
If Not oRs.Eof Then
sToolBar = "<table border=0 cellpadding=0 cellspacing=0 width='100%' class='Toolbar' id='eWebEditor_Toolbar'>"
Do While Not oRs.Eof
sToolBar = sToolBar & "<tr><td><div class=yToolbar>"
aButton = Split(oRs("T_Button"), "|")
For n = 0 To UBound(aButton)
If sFullScreen = "1" And UCase(aButton(n)) = "MAXIMIZE" Then
aButton(n) = "Minimize"
End If
sToolBar = sToolBar & Code2HTML(aButton(n))
Next
sToolBar = sToolBar & "</div></td></tr>"
oRs.MoveNext
Loop
sToolBar = sToolBar & "</table>"
Else
ShowErr "对应样式没有设置工具栏!"
End If
oRs.Close
End Sub
%>