""" Returns an nchor tag to a link (if applicable) or just the name if already there. """ # 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. if _.has_key('default_status_msg'): statusMsg=_.getitem('default_status_msg',1) else: statusMsg='Saugus.net' anchorContent=None if hasattr(location,'internal_title'): anchorContent=location.internal_title anchorUnfContent=location.title_or_id() if not anchorContent and hasattr(location,'formatted_title'): anchorContent=location.formatted_title anchorUnfContent=location.title_or_id() if not anchorContent and hasattr(location,'Title'): if callable(location.Title) and location.Title(): anchorContent=anchorUnfContent=location.Title() elif location.title: anchorContent=anchorUnfContent=location.title if not anchorContent and hasattr(location,'id'): if callable(location.id) and location.id(): anchorContent=anchorUnfContent=location.id() else: anchorContent=anchorUnfContent=location.id if not anchorContent: anchorContent=anchorUnfContent='Home' if hasattr(location,'absolute_url'): testUrl=location.absolute_url() else: testUrl="http://www.saugus.net" if testUrl==context.absolute_url(): print anchorContent else: print '''%s''' % (testUrl,anchorUnfContent,statusMsg,anchorContent) return printed