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

« back to all changes in this revision

Viewing changes to ivle/webapp/base/xhtml.py

  • Committer: William Grant
  • Date: 2009-04-28 05:06:00 UTC
  • Revision ID: grantw@unimelb.edu.au-20090428050600-hogd9d6wo7ksyqy8
ivle.database.get_store() now takes a configuration object.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        for key in kwargs:
49
49
            setattr(self, key, kwargs[key])
50
50
 
 
51
    def filter(self, stream, ctx):
 
52
        return stream
 
53
 
51
54
    def render(self, req):
52
55
        req.content_type = 'text/html' # TODO: Detect application/xhtml+xml
53
56
 
61
64
                        inspect.getmodule(self).__file__), self.template) 
62
65
        loader = genshi.template.TemplateLoader(".", auto_reload=True)
63
66
        tmpl = loader.load(app_template)
64
 
        app = tmpl.generate(viewctx)
 
67
        app = self.filter(tmpl.generate(viewctx), viewctx)
65
68
 
66
69
        for plugin in self.plugin_scripts:
67
70
            for path in self.plugin_scripts[plugin]:
81
84
 
82
85
        ctx['scripts'] = [media_url(req, CorePlugin, path) for path in
83
86
                           ('util.js', 'json2.js', 'md5.js')]
 
87
        ctx['scripts'].append(media_url(req, '+external/jquery', 'jquery.js'))
84
88
        ctx['scripts'] += req.scripts
85
89
 
86
90
        ctx['scripts_init'] = req.scripts_init
87
91
        ctx['app_template'] = app
 
92
        ctx['title_img'] = media_url(req, CorePlugin,
 
93
                                     "images/chrome/title.png")
88
94
        self.populate_headings(req, ctx)
89
95
        tmpl = loader.load(os.path.join(os.path.dirname(__file__), 
90
96
                                                        'ivle-headings.html'))
97
103
        ctx['favicon'] = None
98
104
        ctx['root_dir'] = ivle.conf.root_dir
99
105
        ctx['public_host'] = ivle.conf.public_host
 
106
        ctx['svn_base'] = ivle.conf.svn_addr
100
107
        ctx['write_javascript_settings'] = req.write_javascript_settings
101
108
        if req.user:
102
109
            ctx['login'] = req.user.login
117
124
            for tab in plugin.tabs:
118
125
                # tab is a tuple: name, title, desc, icon, path
119
126
                new_app = {}
120
 
                new_app['this_app'] = hasattr(self, 'appname') \
121
 
                                      and tab[0] == self.appname
 
127
                new_app['this_app'] = hasattr(self, 'tab') \
 
128
                                      and tab[0] == self.tab
122
129
 
123
130
                # Icon name
124
131
                if tab[3] is not None: