Modificare il file:
\FckEditor\inc\fckeditor.asp
<!-- * FCKeditor - The text editor for Internet - http://www.fckeditor.net * Copyright (C) 2003-2007 Frederico Caldeira Knabben * * == BEGIN LICENSE == * * Licensed under the terms of any of the following licenses at your * choice: * * - GNU General Public License Version 2 or later (the "GPL") * http://www.gnu.org/licenses/gpl.html * * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * http://www.gnu.org/licenses/lgpl.html * * - Mozilla Public License Version 1.1 or later (the "MPL") * http://www.mozilla.org/MPL/MPL-1.1.html * * == END LICENSE == * * File Name: fckeditor.asp * This is the integration file for ASP. * * It defines the FCKeditor class that can be used to create editor * instances in ASP pages on server side. * * File Authors: * Frederico Caldeira Knabben (www.fckeditor.net) --> <% Class FCKeditor private sBasePath private sInstanceName private sWidth private sHeight private sToolbarSet private sValue private oConfig 'Gianluigi private sCssPath private sTemplateFolder private sSkinPath private sFontNames private sToolbarList private sDisplay private sFontSizes private sSetupResize private sBgImageForTable private sUploadWinWidth private sUploadWinHeight private sUseSitePath private sUseBrOnCarriageReturn private sAutoDetectLanguage private sDefaultLanguage private sUploadPage private sResizeOptions private sOthersOptions private sAllowedFileType private sMaxUploadFileSize private sRemoveSpecialChar private sRemoveSpecialCharWith private sImageBrowser private sImageUpload private sFlashBrowser private sFlashUpload private sLinkBrowser private sLinkUpload private sImageLink private sTestWritePermission private sNodePath private sOnLoadMessage private sLangDir private sUploadFolder 'Gianluigi Private Sub Class_Initialize() sBasePath = "/FCKeditor/" sWidth = "100%" sHeight = "200" sToolbarSet = "Default" sValue = "" Set oConfig = CreateObject("Scripting.Dictionary") End Sub Public Property Let TestWritePermission( str ) sTestWritePermission = str End Property Public Property Let MaxUploadFileSize( str ) sMaxUploadFileSize = str End Property Public Property Let AllowedFileType( str ) sAllowedFileType = str End Property Public Property Let OthersOptions( str ) sOthersOptions = str End Property Public Property Let ResizeOptions( str ) sResizeOptions = str End Property Public Property Let DefaultLanguage( str ) sDefaultLanguage = str End Property Public Property Let AutoDetectLanguage( str ) sAutoDetectLanguage = str End Property Public Property Let UseBrOnCarriageReturn( str ) sUseBrOnCarriageReturn = str End Property Public Property Let UploadWinWidth( str ) sUploadWinWidth = str End Property Public Property Let UploadWinHeight( str ) sUploadWinHeight = str End Property Public Property Let FontSizes( str ) sFontSizes = str End Property Public Property Let FontList( str ) sFontNames = str End Property Public Property Let SkinPath( str ) sSkinPath = str End Property Public Property Let BasePath( basePathValue ) sBasePath = basePathValue End Property Public Property Let InstanceName( instanceNameValue ) sInstanceName = instanceNameValue End Property Public Property Let Width( widthValue ) sWidth = widthValue End Property Public Property Let Height( heightValue ) sHeight = heightValue End Property Public Property Let ToolbarSet( toolbarSetValue ) sToolbarSet = toolbarSetValue End Property 'Gianluigi Public Property Let UploadFolder( path ) sUploadFolder = path End Property Public Property Let ToolbarList( str ) sToolbarList = str End Property Public Property Let Display( newDisplay ) sDisplay = newDisplay End Property Public Function editorValue() response.write( sValue ) end Function Public Function getDisplay() response.write( sDisplay ) end Function Public Function getWidth() response.write( sWidth ) end Function Public Function getHeight() response.write( sHeight ) end Function 'Gianluigi Public Property Let Value( newValue ) If ( IsNull( newValue ) OR IsEmpty( newValue ) ) Then sValue = "" Else sValue = newValue End If End Property Public Property Let Config( configKey, configValue ) oConfig.Add configKey, configValue End Property Public Function Create( instanceName ) VerifyUploadFolder() oConfig.add "InstanceName", instanceName oConfig.add "OthersOptions", sOthersOptions oConfig.add "ResizeOptions", sResizeOptions oConfig.add "UploadFolder", sUploadFolder oConfig.add "AllowedFileType", sAllowedFileType response.Cookies("FckEditor")("dwzEditorUploadFolder") = sUploadFolder session("dwzEditorUploadFolder") = sUploadFolder dim tmp tmp = split(sOthersOptions,";") sCssPath = tmp(0) sBgImageForTable = tmp(1) sSetupResize = tmp(2) sTemplateFolder = tmp(3) sUseSitePath = tmp(4) sRemoveSpecialChar = tmp(5) sRemoveSpecialCharWith = tmp(6) sLinkBrowser = tmp(7) sLinkUpload = tmp(8) sImageBrowser = tmp(9) sImageUpload = tmp(10) sFlashBrowser = tmp(11) sFlashUpload = tmp(12) sImageLink = tmp(13) sUploadWinWidth = tmp(14) sUploadWinHeight = tmp(15) sUseBROnCarriageReturn = tmp(16) sAutoDetectLanguage = tmp(17) sDefaultLanguage = tmp(18) sMaxUploadFileSize = tmp(19) sNodePath = tmp(20) sOnLoadMessage = tmp(21) sMediaBrowser = tmp(22) sLangDir = tmp(23) oConfig.add "ContentLangDirection", sLangDir oConfig.add "MediaBrowser", sMediaBrowser oConfig.add "MaxUploadFileSize", sMaxUploadFileSize if sCssPath <> "" then oConfig.add "EditorAreaCSS", sCssPath oConfig.add "CssList", getListCss( sCssPath ) end if oConfig.add "SnippetsXmlPath", sTemplateFolder oConfig.add "TemplateFolder", sTemplateFolder oConfig.add "SkinPath", sSkinPath if sFontNames <> "" then oConfig.add "FontNames", sFontNames end if if sFontSizes <> "" then oConfig.add "FontSizes", sFontSizes end if if sSetupResize <> "0" then oConfig.add "SetupResize", sSetupResize end if if sBgImageFortable <> "" then oConfig.add "BgImageForTable", sBgImageForTable end if sNodePath = "false" oConfig.add "NodePath", sNodePath if sUploadWinWidth <> "" then oConfig.add "ImageBrowserWindowWidth", sUploadWinWidth oConfig.add "FlashBrowserWindowWidth", sUploadWinWidth end if if sUploadWinHeight <> "" then oConfig.add "ImageBrowserWindowHeight", sUploadWinHeight oConfig.add "FlashBrowserWindowHeight", sUploadWinHeight end if oConfig.add "dwzUseSitePath", sUseSitePath oConfig.add "UseBROnCarriageReturn", sUseBrOnCarriageReturn oConfig.add "AutoDetectLanguage", sAutoDetectLanguage oConfig.add "DefaultLanguage", sDefaultLanguage if sUploadPage = "" then sUploadPage = "connectors/asp/connector.asp" end if oConfig.add "ToolbarList", sToolbarList tmp = split(sResizeOptions,";") oConfig.add "ImageDlgHideLink", sImageLink oConfig.add "ImageBrowser", sImageBrowser oConfig.add "ImageBrowserURL", sBasePath & "filemanager/browser/default/browser.asp?Type=Image&" & sAllowedFileType & "&Connector=" & sUploadPage & "&ServerPath=" & sUploadFolder & "&Resize=" & tmp(0) & "&ResizeComponent=" & tmp(1) & "&ResizeWidth=" & tmp(2) & "&ResizeHeight=" & tmp(3) & "&ResizeJpegQuality=" & tmp(4) & "&ResizeAspectRatio=" & tmp(5) & "&MaxUploadFileSize=" & sMaxUploadFileSize & "&SetupResize=" & sSetupResize & "&removeSpecialChar=" & sRemoveSpecialChar & "&removeSpecialCharWith=" & sRemoveSpecialCharWith oConfig.add "ImageUpload", sImageUpload oConfig.add "ImageUploadURL", sBasePath & "filemanager/upload/upload.asp?Type=Image&" & sAllowedFileType & "&ServerPath=" & sUploadFolder & "&Resize=" & tmp(0) & "&ResizeComponent=" & tmp(1) & "&ResizeWidth=" & tmp(2) & "&ResizeHeight=" & tmp(3) & "&ResizeJpegQuality=" & tmp(4) & "&ResizeAspectRatio=" & tmp(5) & "&MaxUploadFileSize=" & sMaxUploadFileSize & "&SetupResize=" & sSetupResize & "&removeSpecialChar=" & sRemoveSpecialChar & "&removeSpecialCharWith=" & sRemoveSpecialCharWith oConfig.add "FlashBrowser", sFlashBrowser oConfig.add "FlashBrowserURL", sBasePath & "filemanager/browser/default/browser.asp?Type=Flash&Connector=" & sUploadPage & "&ServerPath=" & sUploadFolder & "&MaxUploadFileSize=" & sMaxUploadFileSize & "&removeSpecialChar=" & sRemoveSpecialChar & "&removeSpecialCharWith=" & sRemoveSpecialCharWith oConfig.add "FlashUpload", sFlashUpload oConfig.add "FlashUploadURL", sBasePath & "filemanager/upload/upload.asp?Type=Flash&ServerPath=" & sUploadFolder & "&MaxUploadFileSize=" & sMaxUploadFileSize & "&removeSpecialChar=" & sRemoveSpecialChar & "&removeSpecialCharWith=" & sRemoveSpecialCharWith oConfig.add "LinkBrowser", sLinkBrowser oConfig.add "LinkBrowserURL", sBasePath & "filemanager/browser/default/browser.asp?Type=File&" & sAllowedFileType & "&Connector=" & sUploadPage & "&ServerPath=" & sUploadFolder & "&Resize=" & tmp(0) & "&ResizeComponent=" & tmp(1) & "&ResizeWidth=" & tmp(2) & "&ResizeHeight=" & tmp(3) & "&ResizeJpegQuality=" & tmp(4) & "&ResizeAspectRatio=" & tmp(5) & "&MaxUploadFileSize=" & sMaxUploadFileSize & "&SetupResize=" & sSetupResize & "&removeSpecialChar=" & sRemoveSpecialChar & "&removeSpecialCharWith=" & sRemoveSpecialCharWith oConfig.add "LinkUpload", sLinkUpload oConfig.add "LinkUploadURL", sBasePath & "filemanager/upload/upload.asp?Type=File&" & sAllowedFileType & "&ServerPath=" & sUploadFolder & "&Resize=" & tmp(0) & "&ResizeComponent=" & tmp(1) & "&ResizeWidth=" & tmp(2) & "&ResizeHeight=" & tmp(3) & "&ResizeJpegQuality=" & tmp(4) & "&ResizeAspectRatio=" & tmp(5) & "&MaxUploadFileSize=" & sMaxUploadFileSize & "&SetupResize=" & sSetupResize & "&removeSpecialChar=" & sRemoveSpecialChar & "&removeSpecialCharWith=" & sRemoveSpecialCharWith oConfig.add "MediaBrowserURL", sBasePath & "filemanager/browser/default/browser.asp?Type=Media&Connector=" & sUploadPage & "&ServerPath=" & sUploadFolder & "&MaxUploadFileSize=" & sMaxUploadFileSize & "&removeSpecialChar=" & sRemoveSpecialChar & "&removeSpecialCharWith=" & sRemoveSpecialCharWith oConfig.add "MediaBrowserWindowWidth", sUploadWinWidth oConfig.add "MediaBrowserWindowHeight", sUploadWinHeight if lcase(sOnLoadMessage) = "true" then response.write("<div id='FckEditorLoadWait_" & instanceName & "'>" & getWaitMessage() & "</div> ") else response.write("<div id='FckEditorLoadWait_" & instanceName & "' style='display:none;'></div> ") end if Response.Write "<div>" If IsCompatible() Then Dim sFile If Request.QueryString( "fcksource" ) = "true" Then sFile = "fckeditor.original.html" Else sFile = "fckeditor.html" End If 'gianluigi 'sFile = "fckeditor.original.html" Dim sLink sLink = sBasePath & sFile & "?InstanceName=" + instanceName If (sToolbarSet & "") <> "" Then sLink = sLink + "&Toolbar=" & sToolbarSet End If 'Gianluigi If (sToolbarList & "") <> "" Then sLink = sLink + "&ToolbarList=" & sToolbarList else sLink = sLink + "&ToolbarList=-1" oConfig.Add "ToolbarStartExpanded", "false" oConfig.Add "ToolbarCanCollapse", "false" End If 'Gianluigi Display = "none" ' Render the linked hidden field. 'Response.Write "<input type=""hidden"" id=""" & instanceName & """ name=""" & instanceName & """ value=""" & Server.HTMLEncode( sValue ) & """ style=""display:none"" />" ' Render the configurations hidden field. Response.Write "<input type=""hidden"" id=""" & instanceName & "___Config"" value=""" & GetConfigFieldString() & """ style=""display:none"" />" ' Render the editor IFRAME. Response.Write "<iframe id=""" & instanceName & "___Frame"" src=""" & sLink & """ width=""" & sWidth & """ height=""" & sHeight & """ frameborder=""0"" scrolling=""no""></iframe>" Else Dim sWidthCSS, sHeightCSS If InStr( sWidth, "%" ) > 0 Then sWidthCSS = sWidth Else sWidthCSS = sWidth & "px" End If If InStr( sHeight, "%" ) > 0 Then sHeightCSS = sHeight Else sHeightCSS = sHeight & "px" End If 'Gianluigi Display = "" 'Response.Write "<textarea name=""" & instanceName & """ rows=""4"" cols=""40"" style=""width: " & sWidthCSS & "; height: " & sHeightCSS & """>" & Server.HTMLEncode( sValue ) & "</textarea>" 'Gianluigi End If Response.Write "</div>" End Function Private Function IsCompatible() Dim sAgent sAgent = Request.ServerVariables("HTTP_USER_AGENT") Dim iVersion If InStr(sAgent, "MSIE") > 0 AND InStr(sAgent, "mac") <= 0 AND InStr(sAgent, "Opera") <= 0 Then iVersion = CInt( ToNumericFormat( Mid(sAgent, InStr(sAgent, "MSIE") + 5, 3) ) ) IsCompatible = ( iVersion >= 5.5 ) ElseIf InStr(sAgent, "Gecko/") > 0 Then iVersion = CLng( Mid( sAgent, InStr( sAgent, "Gecko/" ) + 6, 8 ) ) IsCompatible = ( iVersion >= 20030210 ) Else IsCompatible = False End If End Function ' By Agrotic ' On ASP, when converting string to numbers, the number decimal separator is localized ' so 5.5 will not work on systems were the separator is "," and vice versa. Private Function ToNumericFormat( numberStr ) If IsNumeric( "5.5" ) Then ToNumericFormat = Replace( numberStr, ",", ".") Else ToNumericFormat = Replace( numberStr, ".", ",") End If End Function Private Function GetConfigFieldString() Dim sParams Dim bFirst bFirst = True Dim sKey For Each sKey in oConfig If bFirst = False Then sParams = sParams & "&" Else bFirst = False End If sParams = sParams & EncodeConfig( sKey ) & "=" & EncodeConfig( oConfig(sKey) ) Next GetConfigFieldString = sParams End Function Private Function EncodeConfig( valueToEncode ) EncodeConfig = Replace( valueToEncode, "&", "%26" ) EncodeConfig = Replace( EncodeConfig , "=", "%3D" ) EncodeConfig = Replace( EncodeConfig , """", "%22" ) End Function Private Function VerifyUploadFolder() if sUploadFolder & "" = "" then exit function end if Dim myFs set myFs = server.CreateObject("Scripting.FileSystemObject") if not myFs.FolderExists(server.MapPath(sUploadFolder)) then response.Clear() response.Write("WARNING!!<BR>") response.Write("The Upload folder <b>" & sUploadFolder & "</b> don't exists<br>") response.Write("The Upload folder full path is: <b>" & server.MapPath(sUploadFolder) & "</b><br>") response.Write("The editor cannot start<br>") response.Write("Create the folder and restart<br>") response.End() end if if lcase(sTestWritePermission) = "true" then err.clear on error resume next dim FilePath, FileName FileName = "test.txt" if right(sUploadFolder,1)<>"/" then FileName = "/" & FileName end if FilePath = server.MapPath(sUploadFolder & FileName) dim myFile set myFile = myFs.openTextFile(FilePath,2,true) myFile.write("DwZone Editor - Test write permission") myFile.close set myFile = nothing set myFile = myFs.getFile(FilePath) myFile.delete() if err.number <> 0 then response.Clear() response.Write("WARNING!!<BR>") response.Write("En error occour on the WRITE PERMISSION TEST<br>") response.Write("Error: " & err.description & "<br>") response.Write("The Upload folder full path is: <b>" & server.MapPath(sUploadFolder) & "</b><br>") response.Write("The editor cannot start<br>") response.Write("Verify the write permission and restart<br>") response.End() end if on error goto 0 end if set myFs = nothing end function Public function getListCss( FilePath ) dim Fs set Fs = server.CreateObject( "Scripting.FileSystemObject" ) if not Fs.FileExists( server.MapPath( FilePath ) ) then response.Clear() response.Write("WARNING!!<br>") response.Write("The style file: " & server.MapPath( FilePath ) & " is missing<br>") response.write("Use an existant file or remove the style option") response.End() getListCss = "" exit function end if dim myFile, cont, cong, objRegEx, retStr, Matches, Match set myFile = Fs.openTextFile( server.MapPath( FilePath ) ) cont = myFile.ReadAll myFile.close() set Fs = nothing cont = replace( cont, vbcrlf, " ") cont = replace( cont, vbcr, " ") cont = replace( cont, vbtab, " ") retStr = "" cong = "" Set objRegEx = New RegExp objRegEx.Global = True objRegEx.IgnoreCase = True objRegEx.Pattern = "\.\s*[\w-:]+\s*\{" Set Matches = objRegEx.Execute( cont ) For Each Match in Matches retStr = retStr & cong & trim(replace(replace(Match.value,".",""),"{","")) cong = "," Next if retStr = "" then response.Clear() response.Write("WARNING!!<br>") response.Write("The style file don't contains valid CSS style<br>") response.write("Use a valid file or remove the style option") response.End() end if getListCss = retStr end function function getWaitMessage() dim Fs, retStr retStr = "Wait editor load" set Fs = server.CreateObject( "Scripting.FileSystemObject" ) if Fs.FileExists( server.MapPath( sBasePath & "plugins/EditorLoadWait/EditorLoadWait.html" ) ) then set myFile = Fs.OpenTextFile( server.MapPath( sBasePath & "plugins/EditorLoadWait/EditorLoadWait.html" ), 1) retStr = myFile.readAll myFile.close end if set Fs = nothing getWaitMessage = retStr end function End Class %>
[
Íàçàä
]