[ Index ] |
|
Code source de FCKeditor 2.4 |
1 #!/usr/bin/env python 2 3 """ 4 FCKeditor - The text editor for Internet - http://www.fckeditor.net 5 Copyright (C) 2003-2007 Frederico Caldeira Knabben 6 7 == BEGIN LICENSE == 8 9 Licensed under the terms of any of the following licenses at your 10 choice: 11 12 - GNU General Public License Version 2 or later (the "GPL") 13 http://www.gnu.org/licenses/gpl.html 14 15 - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 16 http://www.gnu.org/licenses/lgpl.html 17 18 - Mozilla Public License Version 1.1 or later (the "MPL") 19 http://www.mozilla.org/MPL/MPL-1.1.html 20 21 == END LICENSE == 22 23 File Name: sample01.py 24 Sample page. 25 26 File Authors: 27 Andrew Liu (andrew@liuholdings.com) 28 """ 29 30 import cgi 31 import os 32 33 # Ensure that the fckeditor.py is included in your classpath 34 import fckeditor 35 36 # Tell the browser to render html 37 print "Content-Type: text/html" 38 print "" 39 40 # Document header 41 print """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 42 <html> 43 <head> 44 <title>FCKeditor - Sample</title> 45 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 46 <meta name="robots" content="noindex, nofollow"> 47 <link href="../sample.css" rel="stylesheet" type="text/css" /> 48 </head> 49 <body> 50 <h1>FCKeditor - Python - Sample 1</h1> 51 This sample displays a normal HTML form with an FCKeditor with full features 52 enabled. 53 <hr> 54 <form action="sampleposteddata.py" method="post" target="_blank"> 55 """ 56 57 # This is the real work 58 try: 59 sBasePath = os.environ.get("SCRIPT_NAME") 60 sBasePath = sBasePath[0:sBasePath.find("_samples")] 61 62 oFCKeditor = fckeditor.FCKeditor('FCKeditor1') 63 oFCKeditor.BasePath = sBasePath 64 oFCKeditor.Value = """This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.""" 65 print oFCKeditor.Create() 66 except Exception, e: 67 print e 68 print """ 69 <br> 70 <input type="submit" value="Submit"> 71 </form> 72 """ 73 74 # For testing your environments 75 print "<hr>" 76 for key in os.environ.keys(): 77 print "%s: %s<br>" % (key, os.environ.get(key, "")) 78 print "<hr>" 79 80 # Document footer 81 print """ 82 </body> 83 </html> 84 """ 85 86
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 15:28:05 2007 | par Balluche grâce à PHPXref 0.7 |