1 # vim: set et sw=4 sts=4 encoding=utf-8 foldmethod=marker :
3 from turbogears import url
4 from turbogears.identity import SecureResource
5 from turbogears import identity
8 def __init__(self, base):
10 self.items = [i for i in dir(base)
11 if isinstance(getattr(base, i), SecureResource)]
13 self.items = ['dashboard'] + self.items
16 return c.require.eval_with_object(identity.current)
19 option = u"""<option value="%s">%s</option>" """
23 <select OnChange="window.location=this.options[this.selectedIndex].value;">
28 s = option % ('', '-----')
30 if i == 'dashboard' or self._check(getattr(self.base, i)):
31 s += option % (url('/' + i), i.capitalize().replace('_', ' '))