"
End Sub
' 初始化样式表数据
Sub InitStyle()
Dim b
b = False
sStyleID = Trim(Request("id"))
If IsNumeric(sStyleID) = True Then
sSql = "select * from ewebeditor_style where s_id=" & sStyleID
oRs.Open sSql, oConn, 0, 1
If Not oRs.Eof Then
sStyleName = oRs("S_Name")
sStyleDir = oRs("S_Dir")
sStyleCSS = oRs("S_CSS")
sStyleUploadDir = oRs("S_UploadDir")
sStyleBaseHref = oRs("S_BaseHref")
sStyleContentPath = oRs("S_ContentPath")
sStyleWidth = CStr(oRs("S_Width"))
sStyleHeight = CStr(oRs("S_Height"))
sStyleMemo = oRs("S_Memo")
nStyleIsSys = oRs("S_IsSys")
sStyleFileExt = oRs("S_FileExt")
sStyleFlashExt = oRs("S_FlashExt")
sStyleImageExt = oRs("S_ImageExt")
sStyleMediaExt = oRs("S_MediaExt")
sStyleRemoteExt = oRs("S_RemoteExt")
sStyleFileSize = oRs("S_FileSize")
sStyleFlashSize = oRs("S_FlashSize")
sStyleImageSize = oRs("S_ImageSize")
sStyleMediaSize = oRs("S_MediaSize")
sStyleRemoteSize = oRs("S_RemoteSize")
sStyleStateFlag = CStr(oRs("S_StateFlag"))
sStyleAutoRemote = CStr(oRs("S_AutoRemote"))
sStyleShowBorder = CStr(oRs("S_ShowBorder"))
sStyleUploadObject = CStr(oRs("S_UploadObject"))
sStyleAutoDir = CStr(oRs("S_AutoDir"))
sStyleDetectFromWord = oRs("S_DetectFromWord")
sStyleInitMode = oRs("S_InitMode")
sStyleBaseUrl = oRs("S_BaseUrl")
b = True
End If
oRs.Close
End If
If b = False Then
Go_Error "无效的样式ID号,请通过页面上的链接进行操作!"
End If
End Sub
' 检测样式表单提交的有效性
Sub CheckStyleForm()
sStyleName = Trim(Request("d_name"))
sStyleDir = Trim(Request("d_dir"))
sStyleCSS = Trim(Request("d_css"))
sStyleUploadDir = Trim(Request("d_uploaddir"))
sStyleBaseHref = Trim(Request("d_basehref"))
sStyleContentPath = Trim(Request("d_contentpath"))
sStyleWidth = Trim(Request("d_width"))
sStyleHeight = Trim(Request("d_height"))
sStyleMemo = Request("d_memo")
sStyleImageExt = Request("d_imageext")
sStyleFlashExt = Request("d_flashext")
sStyleMediaExt = Request("d_mediaext")
sStyleRemoteExt = Request("d_remoteext")
sStyleFileExt = Request("d_fileext")
sStyleImageSize = Request("d_imagesize")
sStyleFlashSize = Request("d_flashsize")
sStyleMediaSize = Request("d_mediasize")
sStyleRemoteSize = Request("d_remotesize")
sStyleFileSize = Request("d_filesize")
sStyleStateFlag = Request("d_stateflag")
sStyleAutoRemote = Request("d_autoremote")
sStyleShowBorder = Request("d_showborder")
sStyleUploadObject = Request("d_uploadobject")
sStyleAutoDir = Request("d_autodir")
sStyleDetectFromWord = Request("d_detectfromword")
sStyleInitMode = Request("d_initmode")
sStyleBaseUrl = Request("d_baseurl")
sStyleUploadDir = Replace(sStyleUploadDir, "\", "/")
sStyleBaseHref = Replace(sStyleBaseHref, "\", "/")
sStyleContentPath = Replace(sStyleContentPath, "\", "/")
If Right(sStyleUploadDir, 1) <> "/" Then sStyleUploadDir = sStyleUploadDir & "/"
If Right(sStyleBaseHref, 1) <> "/" Then sStyleBaseHref = sStyleBaseHref & "/"
If Right(sStyleContentPath, 1) <> "/" Then sStyleContentPath = sStyleContentPath & "/"
If sStyleName = "" Or Get_TrueLen(sStyleName) > 50 Then
Go_Error "样式名不能为空,且不大于50个字符长度!"
End If
If IsSafeStr(sStyleName) = False Then
Go_Error "样式名请勿包含特殊字符!"
End If
If sStyleDir = "" Or Get_TrueLen(sStyleDir) > 50 Then
Go_Error "按钮图片目录名不能为空,且不大于50个字符长度!"
End If
If IsSafeStr(sStyleDir) = False Then
Go_Error "按钮图片目录名请勿包含特殊字符!"
End If
If sStyleCSS = "" Or Get_TrueLen(sStyleCSS) > 50 Then
Go_Error "样式CSS目录名不能为空,且不大于50个字符长度!"
End If
If IsSafeStr(sStyleCSS) = False Then
Go_Error "样式CSS目录名请勿包含特殊字符!"
End If
If sStyleUploadDir = "" Or Get_TrueLen(sStyleUploadDir) > 50 Then
Go_Error "上传路径不能为空,且不大于50个字符长度!"
End If
If IsSafeStr(sStyleUploadDir) = False Then
Go_Error "上传路径请勿包含特殊字符!"
End If
Select Case sStyleBaseUrl
Case "0"
If sStyleBaseHref = "" Or Get_TrueLen(sStyleBaseHref) > 50 Then
Go_Error "当使用相对路径模式时,显示路径不能为空,且不大于50个字符长度!"
End If
If IsSafeStr(sStyleBaseHref) = False Then
Go_Error "当使用相对路径模式时,显示路径请勿包含特殊字符!"
End If
If Left(sStyleBaseHref, 1) <> "/" Then
Go_Error "当使用相对路径模式时,显示路径必须以"/"开头!"
End If
If sStyleContentPath = "" Or Get_TrueLen(sStyleContentPath) > 50 Then
Go_Error "当使用相对路径模式时,内容路径不能为空,且不大于50个字符长度!"
End If
If IsSafeStr(sStyleContentPath) = False Then
Go_Error "当使用相对路径模式时,内容路径请勿包含特殊字符!"
End If
If Left(sStyleContentPath, 1) = "/" Then
Go_Error "当使用相对路径模式时,内容路径不能以"/"开头!"
End If
Case "1", "2"
sStyleBaseHref = ""
sStyleContentPath = ""
End Select
If IsNumeric(sStyleWidth) = False Then
Go_Error "请填写有效的最佳引用宽度!"
End If
If IsNumeric(sStyleHeight) = False Then
Go_Error "请填写有效的最佳引用高度!"
End If
If Get_TrueLen(sStyleImageExt) > 250 Then
Go_Error "图片文件类型不能大于250个字符长度!"
End If
If Get_TrueLen(sStyleFlashExt) > 250 Then
Go_Error "Flash文件类型不能大于250个字符长度!"
End If
If Get_TrueLen(sStyleMediaExt) > 250 Then
Go_Error "媒体文件类型不能大于250个字符长度!"
End If
If Get_TrueLen(sStyleFileExt) > 250 Then
Go_Error "其它文件类型不能大于250个字符长度!"
End If
If Get_TrueLen(sStyleRemoteExt) > 250 Then
Go_Error "远程文件类型不能大于250个字符长度!"
End If
If IsNumeric(sStyleImageSize) = False Then
Go_Error "请填写有效的图片限制大小!"
End If
If IsNumeric(sStyleFlashSize) = False Then
Go_Error "请填写有效的Flash限制大小!"
End If
If IsNumeric(sStyleMediaSize) = False Then
Go_Error "请填写有效的媒体文件限制大小!"
End If
If IsNumeric(sStyleFileSize) = False Then
Go_Error "请填写有效的其它文件限制大小!"
End If
If IsNumeric(sStyleRemoteSize) = False Then
Go_Error "请填写有效的远程文件限制大小!"
End If
End Sub
' 样式新增保存
Sub DoStyleAddSave()
sSql = "select * from ewebeditor_style where s_name='" & sStyleName & "'"
oRs.Open sSql, oConn, 0, 1
If Not oRs.Eof Then
Go_Error "此样式名已经存在,请用另一个样式名!"
End If
oRs.Close
sSql = "select * from ewebeditor_style where s_id=0"
oRs.Open sSql, oConn, 1, 3
oRs.AddNew
oRs("S_Name") = sStyleName
oRs("S_Dir") = sStyleDir
oRs("S_CSS") = sStyleCSS
oRs("S_UploadDir") = sStyleUploadDir
oRs("S_BaseHref") = sStyleBaseHref
oRs("S_ContentPath") = sStyleContentPath
oRs("S_Width") = sStyleWidth
oRs("S_Height") = sStyleHeight
oRs("S_Memo") = sStyleMemo
oRs("S_ImageExt") = sStyleImageExt
oRs("S_FlashExt") = sStyleFlashExt
oRs("S_MediaExt") = sStyleMediaExt
oRs("S_FileExt") = sStyleFileExt
oRs("S_RemoteExt") = sStyleRemoteExt
oRs("S_ImageSize") = sStyleImageSize
oRs("S_FlashSize") = sStyleFlashSize
oRs("S_MediaSize") = sStyleMediaSize
oRs("S_FileSize") = sStyleFileSize
oRs("S_RemoteSize") = sStyleRemoteSize
oRs("S_StateFlag") = sStyleStateFlag
oRs("S_AutoRemote") = sStyleAutoRemote
oRs("S_ShowBorder") = sStyleShowBorder
oRs("S_UploadObject") = sStyleUploadObject
oRs("S_AutoDir") = sStyleAutoDir
oRs("S_DetectFromWord") = sStyleDetectFromWord
oRs("S_InitMode") = sStyleInitMode
oRs("S_BaseUrl") = sStyleBaseUrl
oRs.Update
sStyleID = oRs("S_ID")
oRs.Close
Response.Write "
"
End Sub
' 样式删除
Sub DoStyleDel()
If nStyleIsSys = 0 Then
sSql = "delete from ewebeditor_style where s_id=" & sStyleID
oConn.Execute sSql
sSql = "delete from ewebeditor_toolbar where s_id=" & sStyleID
oConn.Execute sSql
End If
End Sub
' 样式预览
Sub ShowStylePreview()
Response.Write "" & _
"样式预览" & _
"" & _
"" & _
"" & _
"" & _
""
End Sub
' 显示引用代码
Sub ShowStyleCode()
Response.Write "
"
Dim s_AddForm, s_ModiForm
' 增加表单
If nStyleIsSys = 1 Then
s_AddForm = ""
Else
' 取当前最大排序号
Dim nMaxOrder
sSql = "select max(T_order) from ewebeditor_toolbar where s_id=" & sStyleID
oRs.Open sSql, oConn, 0, 1
If IsNull(oRs(0)) Then
nMaxOrder = 1
Else
nMaxOrder = oRs(0) + 1
End If
oRs.Close
s_AddForm = "
" & _
"
"
End If
' 修改表单
Dim s_Manage, s_SubmitButton
s_ModiForm = "
"
' 输出表单
Response.Write s_AddForm & s_ModiForm
End Sub
' 新增工具栏
Sub DoToolBarAdd()
Dim s_Name, s_Order
s_Name = Trim(Request("d_name"))
s_Order = Trim(Request("d_order"))
If s_Name = "" Or Get_TrueLen(s_Name) > 50 Then
Go_Error "工具栏名不能为空,且长度不能大于50个字符长度!"
End If
If IsNumeric(s_Order) = False Then
Go_Error "无效的工具栏排序号,排序号必须为数字!"
End If
If nStyleIsSys = 1 Then
Go_Error "系统自带样式下的工具栏,不允许新增!"
End If
sSql = "select * from ewebeditor_toolbar where 1=0"
oRs.Open sSql, oConn, 1, 3
oRs.AddNew
oRs("s_id") = sStyleID
oRs("t_name") = s_Name
oRs("t_order") = s_Order
oRs("t_button") = ""
oRs.Update
oRs.Close
Response.Write ""
End Sub
' 修改工具栏
Sub DoToolBarModi()
Dim s_Name, s_Order
If nStyleIsSys = 1 Then
Go_Error "系统自带样式下的工具栏,不允许修改!"
End If
sSql = "select * from ewebeditor_toolbar where s_id=" & sStyleID
oRs.Open sSql, oConn, 1, 3
Do While Not oRs.Eof
s_Name = Trim(Request("d_name" & oRs("t_id")))
s_Order = Trim(Request("d_order" & oRs("t_id")))
If s_Name <> "" And IsNumeric(s_Order) = True Then
If s_Name <> oRs("t_name") Or s_Order <> CStr(oRs("t_Order")) Then
oRs("t_name") = s_Name
oRs("t_order") = s_Order
oRs.Update
End If
End If
oRs.MoveNext
Loop
oRs.Close
Response.Write ""
End Sub
' 删除工具栏
Sub DoToolBarDel()
Dim s_DelID
s_DelID = Trim(Request("delid"))
If nStyleIsSys = 1 Then
Go_Error "系统自带样式下的工具栏,不允许删除!"
End If
If IsNumeric(s_DelID) = True Then
sSql = "delete from ewebeditor_toolbar where s_id=" & sStyleID & " and t_id=" & s_DelID
oConn.Execute sSql
Response.Write ""
End If
End Sub
' 初始化工具栏
Sub InitToolBar()
Dim b
b = False
sToolBarID = Trim(Request("toolbarid"))
If IsNumeric(sToolBarID) = True Then
sSql = "select * from ewebeditor_toolbar where s_id=" & sStyleID & " and t_id=" & sToolBarID
oRs.Open sSql, oConn, 0, 1
If Not oRs.Eof Then
sToolBarName = oRs("T_Name")
sToolBarOrder = oRs("T_Order")
sToolBarButton = oRs("T_Button")
b = True
End If
oRs.Close
End If
If b = False Then
Go_Error "无效的工具栏ID号,请通过页面上的链接进行操作!"
End If
End Sub
' 按钮设置
Sub ShowButtonList()
Dim i, n
' 导航
Response.Write "
"
' 取所有按钮
Dim aButtonCode(), aButtonTitle(), aButtonImage()
sSql = "select * from ewebeditor_button where b_allowselect=1 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 aButtonTitle(i)
Redim Preserve aButtonImage(i)
aButtonCode(i) = oRs("B_Code")
aButtonTitle(i) = oRs("B_Title")
aButtonImage(i) = oRs("B_Image")
oRs.MoveNext
Loop
oRs.Close
' 取可选列表
Dim s_Option1
s_Option1 = ""
For i = 1 To UBound(aButtonCode)
s_Option1 = s_Option1 & ""
Next
' 取已选列表
Dim aButton, s_Option2, s_Temp
aButton = Split(sToolBarButton, "|")
s_Option2 = ""
For i = 0 To UBound(aButton)
s_Temp = Code2Title(aButton(i), aButtonCode, aButtonTitle)
If s_Temp <> "" Then
s_Option2 = s_Option2 & ""
End If
Next
'以下为客户端操作选择脚本
'''''''''''''''''''''''''''''''''''
%>
<%
'''''''''''''''''''''''''''''''''''
' 选择设置表单
Dim s_SubmitButton
If nStyleIsSys = 1 Then
s_SubmitButton = ""
Else
s_SubmitButton = ""
End If
Response.Write "
" & _
"
"
' 显示图片对照表
Response.Write "
以下是按钮图片对照表(部分下拉框或特殊按钮可能没图):
"
Response.Write "
"
n = 0
For i = 1 To UBound(aButtonCode)
n = i Mod 4
If n = 1 Then
Response.Write "
"
End If
Response.Write "
"
If aButtonImage(i) <> "" Then
Response.Write ""
End If
Response.Write aButtonTitle(i)
Response.Write "
"
If n = 0 Then
Response.Write "
"
End If
Next
If n > 0 Then
For i = 1 To 4 - n
Response.Write "
"
Next
Response.Write ""
End if
Response.Write "
"
End Sub
' 由按钮代码得到按钮标题
Function Code2Title(s_Code, a_ButtonCode, a_ButtonTitle)
Dim i
Code2Title = ""
For i = 1 To UBound(a_ButtonCode)
If UCase(a_ButtonCode(i)) = UCase(s_Code) Then
Code2Title = a_ButtonTitle(i)
Exit Function
End If
Next
End Function
' 按钮设置保存
Sub DoButtonSave()
Dim s_Button
s_Button = Trim(Request("d_button"))
If nStyleIsSys = 1 Then
Go_Error "系统自带样式,不允许对按钮进行修改!"
End If
sSql = "select * from ewebeditor_toolbar where t_id=" & sToolBarID
oRs.Open sSql, oConn, 1, 3
If Not oRs.Eof Then
oRs("T_Button") = s_Button
oRs.Update
End If
oRs.Close
Response.Write "
"
End Sub
Sub RemoveApplication()
Dim aApplicationName, i
aApplicationName = Application("eWebEditor_ApplicationName")
If IsArray(aApplicationName) = True Then
For i = 1 To UBound(aApplicationName)
Application.Contents.Remove(aApplicationName(i))
Next
Application.Contents.Remove("eWebEditor_ApplicationName")
Application.Contents.Remove("eWebEditor_ApplicationUrl")
End If
End Sub
%>