Modificare il file:
\FckEditor\plugins\snippets\SnippetManager.asp
<!-- * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * File Name: tmplsave.html * User dialog for naming and adding a description to a custom template * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) - original release * Stephen Simmons (enquiries@simmonstech.net) - template management extensions, * and removal of dependence on fck_dialog_commmon.js --> <% SnippetFolder = request("SnippetFolder") 'SnippetFolder = "/Public/Snippets" SnippetFileName = "snippets.xml" if right(SnippetFolder,1)<>"/" then SnippetFolder = SnippetFolder & "/" end if SnippetPath = server.MapPath(SnippetFolder & SnippetFileName) 'response.Clear() 'response.write SnippetPath 'response.end set Fs = server.CreateObject("Scripting.FileSystemObject") VerifyFileExists() if request.Form("saveSnippet")<>"" then set objSnippets = getSnippetsList() newXml = "<?xml version=" & chr(34) & "1.0" & chr(34) & " encoding=" & chr(34) & "utf-8" & chr(34) & " ?>" & vbcrlf newXml = newXml & "<Snippets>" & vbcrlf if request.Form("delete")<>"" then for J=0 to objSnippets(0).childNodes.length - 1 if cstr(J) <> request.Form("IdSnippet") then newXml = newXml & vbtab & "<Snippet title=" & chr(34) & objSnippets(0).childNodes(J).getAttribute("title") & chr(34) & ">" & vbcrlf newXml = newXml & vbtab & vbtab & "<Description>" & objSnippets(0).childNodes(J).childNodes(0).text & "</Description>" & vbcrlf newXml = newXml & vbtab & vbtab & "<Html>" & vbcrlf newXml = newXml & vbtab & vbtab & "<![CDATA[" & objSnippets(0).childNodes(J).childNodes(1).childNodes(0).text & "]]>" & vbcrlf newXml = newXml & vbtab & vbtab & "</Html>" & vbcrlf newXml = newXml & vbtab & "</Snippet>" & vbcrlf end if next elseif request.form("IdSnippet")<>"" then 'Update for J=0 to objSnippets(0).childNodes.length - 1 if cstr(J) = request.Form("IdSnippet") then newXml = newXml & vbtab & "<Snippet title=" & chr(34) & replaceSpecialChar(request("title")) & chr(34) & ">" & vbcrlf newXml = newXml & vbtab & vbtab & "<Description>" & replaceSpecialChar(request("description")) & "</Description>" & vbcrlf newXml = newXml & vbtab & vbtab & "<Html>" & vbcrlf newXml = newXml & vbtab & vbtab & "<![CDATA[" & vbcrlf & request("content") & vbtab & vbtab & "]]>" & vbcrlf newXml = newXml & vbtab & vbtab & "</Html>" & vbcrlf newXml = newXml & vbtab & "</Snippet>" & vbcrlf else newXml = newXml & vbtab & "<Snippet title=" & chr(34) & objSnippets(0).childNodes(J).getAttribute("title") & chr(34) & ">" & vbcrlf newXml = newXml & vbtab & vbtab & "<Description>" & objSnippets(0).childNodes(J).childNodes(0).text & "</Description>" & vbcrlf newXml = newXml & vbtab & vbtab & "<Html>" & vbcrlf newXml = newXml & vbtab & vbtab & "<![CDATA[" & objSnippets(0).childNodes(J).childNodes(1).childNodes(0).text & "]]>" & vbcrlf newXml = newXml & vbtab & vbtab & "</Html>" & vbcrlf newXml = newXml & vbtab & "</Snippet>" & vbcrlf end if next else 'Insert for J=0 to objSnippets(0).childNodes.length - 1 newXml = newXml & vbtab & "<Snippet title=" & chr(34) & objSnippets(0).childNodes(J).getAttribute("title") & chr(34) & ">" & vbcrlf newXml = newXml & vbtab & vbtab & "<Description>" & objSnippets(0).childNodes(J).childNodes(0).text & "</Description>" & vbcrlf newXml = newXml & vbtab & vbtab & "<Html>" & vbcrlf newXml = newXml & vbtab & vbtab & "<![CDATA[" & objSnippets(0).childNodes(J).childNodes(1).childNodes(0).text & "]]>" & vbcrlf newXml = newXml & vbtab & vbtab & "</Html>" & vbcrlf newXml = newXml & vbtab & "</Snippet>" & vbcrlf next newXml = newXml & vbtab & "<Snippet title=" & chr(34) & replaceSpecialChar(request("title")) & chr(34) & ">" & vbcrlf newXml = newXml & vbtab & vbtab & "<Description>" & replaceSpecialChar(request("description")) & "</Description>" & vbcrlf newXml = newXml & vbtab & vbtab & "<Html>" & vbcrlf newXml = newXml & vbtab & vbtab & "<![CDATA[" & vbcrlf & request("content") & vbcrlf & vbtab & vbtab & "]]>" & vbcrlf newXml = newXml & vbtab & vbtab & "</Html>" & vbcrlf newXml = newXml & vbtab & "</Snippet>" & vbcrlf end if newXml = newXml & "</Snippets>" & vbcrlf WriteSnippets(newXml) response.Redirect("SnippetsBrowse.asp?Back=yes&SnippetFolder=" & request("SnippetFolder")) elseif request.QueryString("IdSnippet") <> "" then set objSnippets = getSnippetsList() IdSnippet = clng(request.QueryString("IdSnippet")) Title = objSnippets(0).childNodes(IdSnippet).getAttribute("title") Desc = objSnippets(0).childNodes(IdSnippet).childNodes(0).text Html = objSnippets(0).childNodes(IdSnippet).childNodes(1).childNodes(0).text end if function replaceSpecialChar(str) replaceSpecialChar = replace(str,chr(34),"''") end function function WriteSnippets(XmlCont) set myFile = Fs.OpenTextFile(SnippetPath,2,true) myFile.write(XmlCont) myFile.close set myFile = nothing end function function getSnippetsList() dim objXML on error resume next Set objXML = Server.CreateObject("Microsoft.XMLDOM") if err <> 0 then response.Clear() response.write "You need XML services installed on this server...See <a href='http://www.microsoft.com/xml'>http://www.microsoft.com/xml</a> for more information..." response.end end if on error goto 0 objXML.validateOnParse = True objXML.async = False objXML.load(SnippetPath) set getSnippetsList = objXML.getElementsByTagName("Snippets") set objXML = nothing end function function VerifyFileExists() if not Fs.FileExists(SnippetPath) then set myFile = Fs.OpenTextFile(SnippetPath,2,true) myFile.writeLine("<?xml version=" & chr(34) & "1.0" & chr(34) & " encoding=" & chr(34) & "utf-8" & chr(34) & " ?>" & vbcrlf) myFile.writeLine("<Snippets>" & vbcrlf) myFile.writeLine("</Snippets>" & vbcrlf) myFile.close set myFile = nothing end if end function %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="robots" content="noindex, nofollow"> <style> body { text-align: center; } .effect-box { border: #dcdcdc 2px solid; background-color: #ffffff; overflow: auto; width: 90%; line-height: 30px; color: #000099; font-weight: bold; text-align: center; } .effect-box tr { border-bottom: #dcdcdc 2px solid; } .effect-box td { color: #000099; font-weight: bold; font-size: 18px; padding-right: 10px; padding-bottom: 12px; white-space: nowrap; } .textfx { background-color:#eeeeFF } .button-dialog { border-style: solid; border-color: #9999aa; background-color:#ccccee; margin-top: 10px; } .TplList { border: #dcdcdc 2px solid; background-color: #ffffff; overflow: auto; width: 90%; } .TplItem { margin: 5px; padding: 7px; border: #eeeeee 1px solid; } .TplItem TABLE { display: inline; } .TplTitle { font-weight: bold; } </style> <script language="javascript"> var oEditor = window.parent.InnerDialogLoaded() ; var FCK = oEditor.FCK ; var FCKLang = oEditor.FCKLang ; window.onload = function() { // Translate the dialog box texts. oEditor.FCKLanguageManager.TranslatePage(document) ; } </script> </head> <body scroll="no" style="OVERFLOW: hidden"> <form action='SnippetManager.asp' method="post" name="saveform" id="saveform" > <div id="eList" class="save-box"> <table width="374" border="0" cellspacing="0" cellpadding="4"> <tr> <td width="73"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif"><span fckLang="DlgSnippetsTitleMsg" >Title:</span></font></div></td> <td width="285"><input name="title" type="text" id="title" value="<%=title%>"></td> </tr> <tr> <td><div align="right"><font size="2" face="Arial, Helvetica, sans-serif"><span fckLang="DlgSnippetsDescriptionMsg" >Description:</span></font></div></td> <td><input name="description" type="text" id="description" value="<%=desc%>" size="47"></td> </tr> <tr> <td colspan="2" valign="top"><div align="left"><font size="2" face="Arial, Helvetica, sans-serif"><span fckLang="DlgSnippetsHtmlMsg" >HTML:</span></font></div> <div align="left"> <textarea name="content" cols="65" rows="13" id="content"><%=trim(Html)%></textarea> </div></td> </tr> <%if request("IdSnippet")<>"" then%> <tr> <td valign="top"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif">Delete:</font></div></td> <td><input name="delete" type="checkbox" id="delete" value="checkbox"></td> </tr> <%end if%> <tr> <td colspan="2" align="center" valign="top"> <input type="submit" value="Save" name="submit" class="button-dialog" fcklang="DlgSnippetsSaveMsg" \> <input type="button" value="Back" name="submit2" class="button-dialog" fcklang="DlgSnippetsBackMsg" onClick="location.href='SnippetsBrowse.asp?Back=yes&SnippetFolder=<%=request("SnippetFolder")%>'" \></td> </tr> </table> <br /> <input type="hidden" value="<%=request("SnippetFolder")%>" id="SnippetFolder" name="SnippetFolder" /> <input type="hidden" value="yes" id="saveSnippet" name="saveSnippet" /> <input type="hidden" value="<%=request("IdSnippet")%>" id="IdSnippet" name="IdSnippet" /> </div> </form> </body> </html>
[
Íàçàä
]