~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/dispatch/html.py

  • Committer: mattgiuca
  • Date: 2008-07-15 09:18:02 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:877
pulldown_subj/__init__.py: Added "enrol_user" function which pulls down a user
    and also enrols them in the database.
Added script enrolallusers.py which scriptulously performs automatic
enrolments of all users in the system, similar to remakeallusers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    req: An IVLE request object. Reads attributes such as title. Also used to
39
39
    write to."""
40
40
 
 
41
    # Let the console plugin insert its own styles and scripts if an app
 
42
    # requests it
 
43
    if req.app is not None and (req.app in conf.apps.app_url and
 
44
                                conf.apps.app_url[req.app].useconsole):
 
45
        plugins.console.insert_scripts_styles(req.scripts, req.styles, \
 
46
            req.scripts_init)
 
47
 
41
48
    # Write the XHTML opening and head element
42
49
    # Note the inline JavaScript, which provides the client with constants
43
50
    # derived from the server configuration.
93
100
  <h2>Informatics Virtual Learning Environment</h2>
94
101
""")
95
102
 
96
 
    if req.publicmode:
97
 
        req.write('   <p class="userhello">Running in public mode.</p>')
98
 
    elif req.user:
 
103
    if req.user:
99
104
        # Get the user's nickname from the request session
100
105
        nickname = req.user.nick
101
106
        req.write('  <p class="userhello"><span id="usernick">%s</span> '
134
139
 
135
140
    req: An IVLE request object. Written to.
136
141
    """
 
142
    
 
143
    # Write the console html if the app requests it
 
144
    if req.app is not None and (req.app in conf.apps.app_url and
 
145
                                conf.apps.app_url[req.app].useconsole):
 
146
        plugins.console.present(req, windowpane=True)
 
147
 
137
148
    req.write("</div>\n</body>\n</html>\n")
138
149
 
139
150
def get_help_url(req):
144
155
        # We're already in help. Link to the exact current page
145
156
        # instead of the generic help page.
146
157
        return req.uri
147
 
    if reqapp is not None and reqapp in conf.apps.app_url and \
148
 
        conf.apps.app_url[reqapp].hashelp:
 
158
    if reqapp is not None and conf.apps.app_url[reqapp].hashelp:
149
159
        help_path = os.path.join('help', reqapp)
150
160
    else:
151
161
        help_path = 'help'