# Copyright © 2004 Saugus.net, Inc. # All Rights Reserved. # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. from string import join result = [] portal_url = context.portal_url() if include_root: result.append( { 'id' : 'Home' , 'title' : context.portal_properties.title() , 'url' : portal_url } ) relative = context.portal_url.getRelativeContentPath( context ) portal = context.portal_url.getPortalObject() for i in range( len( relative ) ): now = relative[ :i+1 ] obj = portal.restrictedTraverse( now ) if not now[ -1 ] == 'talkback': result.append( { 'id' : now[ -1 ] , 'title' : obj.Title() , 'url' : portal_url + '/' + join( now, '/' ) } ) return result