~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/FCK/_samples/py/sampleposteddata.py

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
This page lists the data posted by a form.
 
24
"""
 
25
 
 
26
import cgi
 
27
import os
 
28
 
 
29
# Tell the browser to render html
 
30
print "Content-Type: text/html"
 
31
print ""
 
32
 
 
33
try:
 
34
        # Create a cgi object
 
35
        form = cgi.FieldStorage()
 
36
except Exception, e:
 
37
        print e
 
38
 
 
39
# Document header
 
40
print """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
41
<html>
 
42
        <head>
 
43
                <title>FCKeditor - Samples - Posted Data</title>
 
44
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 
45
                <meta name="robots" content="noindex, nofollow">
 
46
                <link href="../sample.css" rel="stylesheet" type="text/css" />
 
47
        </head>
 
48
        <body>
 
49
"""
 
50
 
 
51
# This is the real work
 
52
print """
 
53
                <h1>FCKeditor - Samples - Posted Data</h1>
 
54
                This page lists all data posted by the form.
 
55
                <hr>
 
56
                <table width="100%" border="1" cellspacing="0" bordercolor="#999999">
 
57
                        <tr style="FONT-WEIGHT: bold; COLOR: #dddddd; BACKGROUND-COLOR: #999999">
 
58
                                <td nowrap>Field Name&nbsp;&nbsp;</td>
 
59
                                <td>Value</td>
 
60
                        </tr>
 
61
"""
 
62
for key in form.keys():
 
63
        try:
 
64
                value = form[key].value
 
65
                print """
 
66
                                <tr>
 
67
                                        <td valign="top" nowrap><b>%s</b></td>
 
68
                                        <td width="100%%">%s</td>
 
69
                                </tr>
 
70
                        """ % (key, value)
 
71
        except Exception, e:
 
72
                print e
 
73
print "</table>"
 
74
 
 
75
# For testing your environments
 
76
print "<hr>"
 
77
for key in os.environ.keys():
 
78
        print "%s: %s<br>" % (key, os.environ.get(key, ""))
 
79
print "<hr>"
 
80
 
 
81
# Document footer
 
82
print """
 
83
        </body>
 
84
</html>
 
85
"""