pax_global_header00006660000000000000000000000064122633003460014511gustar00rootroot0000000000000052 comment=72cb375d183355432a4ac90d22d6de37aa4c80ce trac-navadd-0.3+svn13554/000077500000000000000000000000001226330034600147435ustar00rootroot00000000000000trac-navadd-0.3+svn13554/COPYING000066400000000000000000000026321226330034600160010ustar00rootroot00000000000000Copyright (C) 2006 Michael Renzmann All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. trac-navadd-0.3+svn13554/navadd/000077500000000000000000000000001226330034600162005ustar00rootroot00000000000000trac-navadd-0.3+svn13554/navadd/__init__.py000066400000000000000000000000011226330034600203000ustar00rootroot00000000000000 trac-navadd-0.3+svn13554/navadd/navadd.py000066400000000000000000000027521226330034600200150ustar00rootroot00000000000000# -*- coding: utf-8 -*- # # Copyright (C) 2006 Michael Renzmann # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. from genshi.builder import tag from trac.config import ListOption from trac.core import Component, ExtensionPoint, implements from trac.web.chrome import INavigationContributor class NavAdd(Component): """ Allows to add items to main and meta navigation bar""" implements(INavigationContributor) nav_items = ListOption('navadd', 'add_items', doc="Items that will be added to the navigation") # INavigationContributor methods def get_active_navigation_item(self, req): return '' def get_navigation_items(self, req): items = [] for name in self.nav_items: title = self.env.config.get('navadd', '%s.title' % name) href = self.env.config.get('navadd', '%s.url' % name) perm = self.env.config.get('navadd', '%s.perm' % name) target = self.env.config.get('navadd', '%s.target' % name) if perm and not req.perm.has_permission(perm): continue if target not in ('mainnav', 'metanav'): target = 'mainnav' if not href.startswith(('http://', 'https://', '/')): href = req.href + href items.append((target, name, tag.a(title, href=href))) return items trac-navadd-0.3+svn13554/setup.cfg000066400000000000000000000000571226330034600165660ustar00rootroot00000000000000[egg_info] tag_build = tag_svn_revision = true trac-navadd-0.3+svn13554/setup.py000066400000000000000000000013261226330034600164570ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2006 Michael Renzmann # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. from setuptools import setup setup(name='NavAdd', version='0.3', packages=['navadd'], author='Michael Renzmann', author_email='mrenzmann@otaku42.de', license='3-Clause BSD', url='http://trac-hacks.org/wiki/NavAddPlugin', description='A plugin for adding navigation items into one of the navigation bars.', keywords='trac navigation main meta', entry_points={'trac.plugins': ['navadd.navadd = navadd.navadd']} )