35
root_dir = conf.root_dir
38
"""Handles a request which may be to anywhere in the site except media.
39
Intended to be called by mod_python, as a handler.
41
req: An Apache request object.
35
43
# TEMP: Dummy (test) handler
36
44
req.content_type = "text/html"
38
req.write("<p>Hello, IVLE!</p>")
39
req.write('<p><img src="' + os.path.join(conf.root_dir,
40
"media/images/mime/dir.png") + '" /> ')
46
req.write("<p>Hello, IVLE!</p>\n")
47
req.write('<p><img src="' + make_path("media/images/mime/dir.png")
41
49
req.write(str(req.uri))
42
req.write("</p></html>")
58
"""Given a path relative to the IVLE root, makes the path relative to the
59
site root using conf.root_dir. This path can be used in URLs sent to the
61
return os.path.join(root_dir, path)
63
def print_apps_list(file):
64
"""Prints all app tabs, as a UL. Prints a list item for each app that has
67
file: Object with a "write" method - ie. the request object.
70
file.write('<ul class="apptabs">\n')
72
for urlname in conf.apps.apps_in_tabs:
73
app = conf.apps.app_url[urlname]
74
file.write(' <li><a href="')
75
file.write(make_path(app.dir))
78
file.write('</a></li>\n')