Changeset 667
- Timestamp:
- 04/16/06 03:12:08 (3 years ago)
- Files:
-
- navmoverplugin/navmover/navmover.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
navmoverplugin/navmover/navmover.py
r666 r667 1 1 from trac.core import * 2 2 from trac.web.chrome import INavigationContributor, ITemplateProvider, add_stylesheet 3 from trac.util import Markup 3 4 4 5 class NavMover(Component): … … 23 24 else: 24 25 move_from = 'mainnav' 26 25 27 # Hide the appropriate nav block 26 28 add_stylesheet(req, 'navmover/css/hide_%s.css' % move_from) … … 31 33 for item in contributor.get_navigation_items(req): 32 34 if (not move_items or item[1] in move_items) and item[0] == move_from \ 33 and not unicode(item[2]).startswith('logged in as'):35 and unicode(item[2]).startswith('<a '): 34 36 meta_items.append((move_to, item[1], item[2])) 35 37 38 # Add custom items 39 for item, title in [o for o in self.env.config.options('navmover') 40 if '.' not in o[0] and o[0] not in ('move_items', 'move_to')]: 41 url = self.env.config.get('navmover', '%s.url' % item) 42 perm = self.env.config.get('navmover', '%s.permission' % item) 43 if perm and not req.perm.has_permission(perm): 44 continue 45 meta_items.append((move_to, item, Markup('<a href="%s">%s</a>' % (url, title)))) 36 46 return meta_items 37 47
