~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: 2010-02-11 06:23:32 UTC
  • Revision ID: grantw@unimelb.edu.au-20100211062332-w9g83pdwznugbudl
Shift the Users link to between Subjects and Help.

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
                continue
163
163
 
164
164
            for tab in plugin.tabs:
165
 
                # tab is a tuple: name, title, desc, icon, path
 
165
                # tab is a tuple: name, title, desc, icon, path, weight, admin
 
166
                # (Admin is optional, defaults to false)
166
167
                new_app = {}
167
168
                new_app['this_app'] = hasattr(self, 'tab') \
168
169
                                      and tab[0] == self.tab
176
177
                        ctx['favicon'] = icon_url
177
178
                else:
178
179
                    new_app['has_icon'] = False
 
180
                # The following check is here, so it is AFTER setting the
 
181
                # icon, but BEFORE actually installing the tab in the menu
 
182
                if len(tab) > 6 and tab[6]:
 
183
                    # Admin-only tab
 
184
                    if not (req.user and req.user.admin):
 
185
                        break
179
186
                new_app['path'] = req.make_path(tab[4])
180
187
                new_app['desc'] = tab[2]
181
188
                new_app['name'] = tab[1]