Rev 1075 | Blame | Last modification | View Log | RSS feed
<%* FCKeditor - The text editor for internet* Copyright (C) 2003-2006 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: sampleposteddata.afp* This page lists the data posted by a form.** Version: 1.0* Modified: 2005-07-01** File Authors: Soenke Freitag (www.afp-hosting.de)*DEFINE CLASS goFckeditor AS CONTAINER OLEPUBLICcInstanceName =""BasePath =""cWIDTH =""cHEIGHT =""ToolbarSet =""cValue=""DIMENSION aConfig(10,2)&& -----------------------------------------------------------------------FUNCTION fckeditor( tcInstanceName )LOCAL lnLoop,lnLoop2THIS.cInstanceName = tcInstanceNameTHIS.BasePath = '/fckeditor/'THIS.cWIDTH = '100%'THIS.cHEIGHT = '200'THIS.ToolbarSet = 'Default'THIS.cValue = ''FOR lnLoop=1 TO 10FOR lnLoop2=1 TO 2THIS.aConfig(lnLoop,lnLoop2) = ""NEXTNEXTRETURNENDFUNC&& -----------------------------------------------------------------------FUNCTION CREATE()? THIS.CreateHtml()RETURNENDFUNC&& -----------------------------------------------------------------------FUNCTION CreateHtml()LOCAL htmlLOCAL lcLinkHtmlValue = THIS.cValue && HTMLSPECIALCHARS()html = [<div>]IF THIS.IsCompatible()lcLink = THIS.BasePath+[editor/fckeditor.html?InstanceName=]+THIS.cInstanceNameIF ( THIS.ToolbarSet # '' )lcLink = lcLink + [Toolbar=]+THIS.ToolbarSetENDIF&& Render the LINKED HIDDEN FIELD.html = html + [<input type="hidden" id="]+THIS.cInstanceName +[" name="]+THIS.cInstanceName +[" value="]+HtmlValue+[" style="display:none" />]&& Render the configurations HIDDEN FIELD.html = html + [<input type="hidden" id="]+THIS.cInstanceName +[___Config" value="]+THIS.GetConfigFieldString() + [" style="display:none" />] +CHR(13)+CHR(10)&& Render the EDITOR IFRAME.html = html + [<iframe id="]+THIS.cInstanceName +[___Frame" src="Link" width="]+THIS.cWIDTH+[" height="]+THIS.cHEIGHT+[" frameborder="0" scrolling="no"></iframe>]ELSEIF ( AT("%", THIS.cWIDTH)=0 )WidthCSS = THIS.cWIDTH + 'px'ELSEWidthCSS = THIS.cWIDTHENDIFIF ( AT("%",THIS.cHEIGHT)=0 )HeightCSS = THIS.cHEIGHT + 'px'ELSEHeightCSS = THIS.cHEIGHTENDIFhtml = html + [<textarea name="]+THIS.cInstanceName +[" rows="4" cols="40" style="width: ]+WidthCSS+[ height: ]+HeightCSS+[">]+HtmlValue+[</textarea>]ENDIFhtml = html + [</div>]RETURN (html)ENDFUNC&& -----------------------------------------------------------------------FUNCTION IsCompatible()LOCAL llRetvalLOCAL sAgentllRetval=.F.sAgent = LOWER(ALLTRIM(request.servervariables("HTTP_USER_AGENT")))IF AT("msie",sAgent) >0 .AND. AT("mac",sAgent)=0 .AND. AT("opera",sAgent)=0iVersion=VAL(SUBSTR(sAgent,AT("msie",sAgent)+5,3))llRetval= iVersion > 5.5ELSEIF AT("gecko",sAgent)>0iVersion=VAL(SUBSTR(sAgent,AT("gecko/",sAgent)+6,8))llRetval =iVersion > 20030210ENDIFENDIFRETURN (llRetval)ENDFUNC&& -----------------------------------------------------------------------FUNCTION GetConfigFieldString()LOCAL sParamsLOCAL bFirstLOCAL sKeysParams = ""bFirst = .T.FOR lnLoop=1 TO 10 && ALEN(this.aconfig)IF !EMPTY(THIS.aConfig(lnLoop,1))IF bFirst = .F.sParams = sParams + "&"ELSEbFirst = .F.ENDIFsParams = sParams +THIS.aConfig(lnLoop,1)+[=]+THIS.aConfig(lnLoop,2)ELSEEXITENDIFNEXTRETURN(sParams)ENDFUNCENDDEFINE%>