def render_editor(name, value): import fckeditor, i18n sBasePath = links.pc_links.fckeditor_base oFCKeditor = fckeditor.FCKeditor(name) oFCKeditor.BasePath = sBasePath oFCKeditor.Value = render_text(value or "") oFCKeditor.Config = { "CustomConfigurationsPath": links.pc_links("editor_base_url", AutoDetectLanguage="false", DefaultLanguage=i18n.getLanguage()) } return oFCKeditor.Create()
<link href="../sample.css" rel="stylesheet" type="text/css" /> </head> <body> <h1>FCKeditor - Python - Sample 1</h1> This sample displays a normal HTML form with an FCKeditor with full features enabled. <hr> <form action="sampleposteddata.py" method="post" target="_blank"> """ # This is the real work try: sBasePath = os.environ.get("SCRIPT_NAME") sBasePath = sBasePath[0:sBasePath.find("_samples")] oFCKeditor = fckeditor.FCKeditor('FCKeditor1') oFCKeditor.BasePath = sBasePath oFCKeditor.Value = """This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.""" print oFCKeditor.Create() except Exception, e: print e print """ <br> <input type="submit" value="Submit"> </form> """ # For testing your environments print "<hr>" for key in os.environ.keys(): print "%s: %s<br>" % (key, os.environ.get(key, ""))