<% '☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆ '★ ★ '☆ eWebEditor - eWebSoft在线编辑器 ☆ '★ ★ '☆ 版权所有: eWebSoft.com ☆ '★ ★ '☆ 程序制作: eWeb开发团队 ☆ '★ email:webmaster@webasp.net ★ '☆ QQ:589808 ☆ '★ ★ '☆ 相关网址: [产品介绍]http://www.eWebSoft.com/Product/eWebEditor/ ☆ '★ [支持论坛]http://bbs.eWebSoft.com/ ★ '☆ ☆ '★ 主页地址: http://www.eWebSoft.com/ eWebSoft团队及产品 ★ '☆ http://www.webasp.net/ WEB技术及应用资源网站 ☆ '★ http://bbs.webasp.net/ WEB技术交流论坛 ★ '★ ★ '☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆ %> <% Dim sStyleID, sStyleName, sStyleDir, sStyleCSS, sStyleUploadDir, sStyleWidth, sStyleHeight, sStyleMemo, nStyleIsSys, sStyleStateFlag, sStyleDetectFromWord, sStyleInitMode, sStyleBaseUrl, sStyleUploadObject, sStyleAutoDir, sStyleBaseHref, sStyleContentPath, sStyleAutoRemote, sStyleShowBorder Dim sStyleFileExt, sStyleFlashExt, sStyleImageExt, sStyleMediaExt, sStyleRemoteExt, sStyleFileSize, sStyleFlashSize, sStyleImageSize, sStyleMediaSize, sStyleRemoteSize Dim sToolBarID, sToolBarName, sToolBarOrder, sToolBarButton sPosition = sPosition & "样式管理" If sAction = "STYLEPREVIEW" Then ' 样式预览 Call InitStyle() Call ShowStylePreview() Response.End End If Call Header() Call Content() Call Footer() Sub Content() Select Case sAction Case "COPY" ' 拷贝一标准样式 Call InitStyle() Call DoCopy() Call ShowStyleList() Case "STYLEADD" ' 新增样式表单 Call ShowStyleForm("ADD") Case "STYLESET" ' 样式设置,修改或查看 Call InitStyle() Call ShowStyleForm("SET") Case "STYLEADDSAVE" ' 样式新增保存 Call CheckStyleForm() Call DoStyleAddSave() Case "STYLESETSAVE" ' 样式设置修改保存 Call CheckStyleForm() Call DoStyleSetSave() Call RemoveApplication() Case "STYLEDEL" ' 样式删除 Call InitStyle() Call DoStyleDel() Call ShowStyleList() Call RemoveApplication() Case "CODE" ' 显示引用代码 Call InitStyle() Call ShowStyleCode() Case "TOOLBAR" ' 显示工具栏表单 Call InitStyle() Call ShowToolBarList() Case "TOOLBARADD" ' 新增工具栏 Call InitStyle() Call DoToolBarAdd() Call ShowToolBarList() Call RemoveApplication() Case "TOOLBARMODI" ' 修改工具栏 Call InitStyle() Call DoToolBarModi() Call ShowToolBarList() Call RemoveApplication() Case "TOOLBARDEL" ' 删除工具栏 Call InitStyle() Call DoToolBarDel() Call ShowToolBarList() Call RemoveApplication() Case "BUTTONSET" ' 按钮设置 Call InitStyle() Call InitToolBar() Call ShowButtonList() Case "BUTTONSAVE" ' 按钮设置保存 Call InitStyle() Call InitToolBar() Call DoButtonSave() Call RemoveApplication() Case Else ' 当前所有样式列表 Call ShowStyleList() End Select End Sub ' 当前所有样式列表 Sub ShowStyleList() Response.Write "" & _ "" & _ "
以下为当前所有样式列表:新增样式
" Response.Write "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" Dim sManage sSql = "select * from ewebeditor_style" oRs.Open sSql, oConn, 0, 1 Do While Not oRs.Eof sManage = "预览|代码|设置|工具栏" If oRs("S_IsSys") = 1 Then sManage = sManage & "|拷贝" Else sManage = sManage & "|删除" End If Response.Write "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" oRs.MoveNext Loop oRs.Close Response.Write "
样式名最佳宽度最佳高度说明管理
" & outHTML(oRs("S_Name")) & "" & oRs("S_Width") & "" & oRs("S_Height") & "" & outHTML(oRs("S_Memo")) & "" & sManage & "
" Response.Write "

说明:系统自带样式不允许对设置进行修改删除,但允许查看设置!你可以先“拷贝一标准样式”然后对其设置进行修改以达到快速新建样式的目的。



" End Sub ' 拷贝一标准样式 Sub DoCopy() ' 只有系统样式才有拷贝功能 If nStyleIsSys <> 1 Then Exit Sub End If ' 自动取有效的样式名,从1......到... Dim i, b, sNewID, sNewName b = False i = 0 Do While b = False i = i + 1 sNewName = sStyleName & i sSql = "select s_id from ewebeditor_style where s_name='" & sNewName & "'" oRs.Open sSql, oConn, 0, 1 If oRs.Eof And oRs.Bof Then b = True End If oRs.Close Loop ' 插入一与标准样式相同的记录,名不同 sSql = "insert into ewebeditor_style(s_name,s_dir,s_css,s_uploaddir,s_width,s_height,s_memo,s_issys,s_fileext,s_flashext,s_imageext,s_mediaext, s_remoteext,s_filesize,s_flashsize,s_imagesize,s_mediasize,s_remotesize,s_stateflag,s_detectfromword,s_initmode,s_baseurl,s_uploadobject,s_basehref,s_contentpath) select '" & sNewName & "',s_dir,s_css,s_uploaddir,s_width,s_height,s_memo,0,s_fileext,s_flashext,s_imageext,s_mediaext,s_remoteext,s_filesize,s_flashsize,s_imagesize,s_mediasize,s_remotesize,s_stateflag,s_detectfromword,s_initmode,s_baseurl,s_uploadobject,s_basehref,s_contentpath from ewebeditor_style where s_id=" & sStyleID oConn.Execute sSql ' 取新样式的ID sSql = "select s_id from ewebeditor_style where s_name='" & sNewName & "'" oRs.Open sSql, oConn, 0, 1 sNewID = oRs(0) oRs.Close ' 拷贝工具栏 sSql = "insert into ewebeditor_toolbar(s_id,t_name,t_order,t_button) select " & sNewID & ",t_name,t_order,t_button from ewebeditor_toolbar where s_id=" & sStyleID oConn.Execute sSql End Sub ' 样式表单 Sub ShowStyleForm(sFlag) Dim s_Title, s_Button, s_Action Dim s_FormStateFlag, s_FormDetectFromWord, s_FormInitMode, s_FormBaseUrl, s_FormUploadObject, s_FormAutoDir, s_FormAutoRemote, s_FormShowBorder If sFlag = "ADD" Then sStyleID = "" sStyleName = "" sStyleDir = "standard" sStyleCSS = "office" sStyleUploadDir = "UploadFile/" sStyleBaseHref = "http://Localhost/eWebEditor/" sStyleContentPath = "UploadFile/" sStyleWidth = "600" sStyleHeight = "400" sStyleMemo = "" nStyleIsSys = 0 s_Title = "新增样式" s_Action = "StyleAddSave" sStyleFileExt = "rar|zip|exe|doc|xls|chm|hlp" sStyleFlashExt = "swf" sStyleImageExt = "gif|jpg|jpeg|bmp" sStyleMediaExt = "rm|mp3|wav|mid|midi|ra|avi|mpg|mpeg|asf|asx|wma|mov" sStyleRemoteExt = "gif|jpg|bmp" sStyleFileSize = "500" sStyleFlashSize = "100" sStyleImageSize = "100" sStyleMediaSize = "100" sStyleRemoteSize = "100" sStyleStateFlag = "1" sStyleAutoRemote = "1" sStyleShowBorder = "0" sStyleUploadObject = "0" sStyleAutoDir = "0" sStyleDetectFromWord = "true" sStyleInitMode = "EDIT" sStyleBaseUrl = "0" Else sStyleName = inHTML(sStyleName) sStyleDir = inHTML(sStyleDir) sStyleCSS = inHTML(sStyleCSS) sStyleUploadDir = inHTML(sStyleUploadDir) sStyleBaseHref = inHTML(sStyleBaseHref) sStyleContentPath = inHTML(sStyleContentPath) sStyleMemo = inHTML(sStyleMemo) s_Title = "设置样式" s_Action = "StyleSetSave" End If s_FormStateFlag = InitSelect("d_stateflag", Split("显示|不显示", "|"), Split("1|0", "|"), sStyleStateFlag, "", "") s_FormAutoRemote = InitSelect("d_autoremote", Split("自动上传|不自动上传", "|"), Split("1|0", "|"), sStyleAutoRemote, "", "") s_FormShowBorder = InitSelect("d_showborder", Split("默认显示|默认不显示", "|"), Split("1|0", "|"), sStyleShowBorder, "", "") s_FormUploadObject = InitSelect("d_uploadobject", Split("无惧无组件上传类|ASPUpload上传组件|SA-FileUp上传组件|LyfUpload上传组件", "|"), Split("0|1|2|3", "|"), sStyleUploadObject, "", "") s_FormAutoDir = InitSelect("d_autodir", Split("不使用|年目录|年月目录|年月日目录", "|"), Split("0|1|2|3", "|"), sStyleAutoDir, "", "") s_FormDetectFromWord = InitSelect("d_detectfromword", Split("自动检测有提示|不自动检测", "|"), Split("true|false", "|"), sStyleDetectFromWord, "", "") s_FormInitMode = InitSelect("d_initmode", Split("代码模式|编辑模式|文本模式|预览模式", "|"), Split("CODE|EDIT|TEXT|VIEW", "|"), sStyleInitMode, "", "") s_FormBaseUrl = InitSelect("d_baseurl", Split("相对路径|绝对根路径|绝对全路径", "|"), Split("0|1|2", "|"), sStyleBaseUrl, "", "") If nStyleIsSys = 0 Then s_Button = " " Else s_Button = "" End If Response.Write "
返回
" Response.Write "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & s_Button & _ "" & _ "
  " & s_Title & "(鼠标移到输入框可看说明,带*号为必填项)
样式名称: *初始模式:" & s_FormInitMode & " *
上传组件:" & s_FormUploadObject & " *自动目录:" & s_FormAutoDir & " *
图片目录: *样式目录: *
最佳宽度: *最佳高度: *
状 态 栏:" & s_FormStateFlag & " *Word粘贴:" & s_FormDetectFromWord & " *
远程文件:" & s_FormAutoRemote & " *指导方针:" & s_FormShowBorder & " *
   上传文件及系统文件路径相关设置(只有在使用相对路径模式时,才要设置显示路径和内容路径):
路径模式:" & s_FormBaseUrl & " * 说明上传路径: *
显示路径:内容路径:
   允许上传文件类型及文件大小设置(文件大小单位为KB,0表示没有限制):
图片类型:图片限制:
Flash类型:Flash限制:
媒体类型:媒体限制:
其它类型:其它限制:
远程类型:远程限制:
备注说明:
" Response.Write "

路径模式设置说明:
" & _ "相对路径:指所有的相关上传或自动插入文件路径,编辑后都以""UploadFile/...""或""../UploadFile/...""形式呈现,当使用此模式时,显示路径和内容路径必填,显示路径必须以""/""开头和结尾,内容路径设置中不能以""/""开头。
" & _ "绝对根路径:指所有的相关上传或自动插入文件路径,编辑后都以""/eWebEditor/UploadFile/...""这种形式呈现,当使用此模式时,显示路径和内容路径不必填。
" & _ "绝对全路径:指所有的相关上传或自动插入文件路径,编辑后都以""http://xxx.xxx.xxx/eWebEditor/UploadFile/...""这种形式呈现,当使用此模式时,显示路径和内容路径不必填。



" 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 DoStyleSetSave() sStyleID = Trim(Request("id")) If IsNumeric(sStyleID) = True Then ' 是否存在同名 sSql = "select * from ewebeditor_style where s_name='" & sStyleName & "' and s_id<>" & sStyleID 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=" & sStyleID oRs.Open sSql, oConn, 1, 3 If Not oRs.Eof Then If oRs("S_IsSys") = 1 Then Go_Error "系统样式,不允许修改!" End If Else Go_Error "无效的样式ID号,请通过页面上的链接进行操作!" End If 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_RemoteSize") = sStyleRemoteSize oRs("S_FileSize") = sStyleFileSize 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 oRs.Close Else Go_Error "无效的样式ID号,请通过页面上的链接进行操作!" End If 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 "
返回
" Response.Write "

样式(" & outHTML(sStyleName) & ")的最佳调用代码如下(其中XXX按实际关联的表单项进行修改):

" Response.Write "

" End Sub ' 显示工具栏表单列表 Sub ShowToolBarList() Response.Write "" & _ "" & _ "
样式(" & outHTML(sStyleName) & ")下的工具栏管理:返回样式管理
" 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 = "
" & _ "" & _ "" sSql = "select * from ewebeditor_toolbar where s_id=" & sStyleID & " order by t_order asc" oRs.Open sSql, oConn, 0, 1 Do While Not oRs.Eof s_Manage = "按钮设置" If nStyleIsSys <> 1 Then s_Manage = s_Manage & "|删除" End If s_ModiForm = s_ModiForm & "" & _ "" & _ "" & _ "" & _ "" & _ "" oRs.MoveNext Loop oRs.Close If nStyleIsSys = 1 Then s_SubmitButton = "" Else s_SubmitButton = "

" End If s_ModiForm = s_ModiForm & "
ID工具栏名排序号操作
" & oRs("t_id") & "" & s_Manage & "
" & s_SubmitButton & "


" ' 输出表单 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 "" & _ "" & _ "" & _ "
当前样式:" & outHTML(sStyleName) & "  当前工具栏:" & outHTML(sToolBarName) & "返回工具栏管理 | 返回样式管理
" ' 取所有按钮 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 "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "" & _ "
可选按钮已选按钮





" & s_SubmitButton & "
" ' 显示图片对照表 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 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 "
" If aButtonImage(i) <> "" Then Response.Write "" End If Response.Write aButtonTitle(i) 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 %>