# Script (Python) "OpenBodyTag" """ Creates an HTML body tag based upon acquired parameters. """ # 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. def getBodyAttribute(attrPair): """ Expects a tuple containing the Zope property and the HTML body attribute. Returns the HTML for the attribute. """ attrStr="" if _.has_key(attrPair[0]): attrVal=_.getitem(attrPair[0]) if _.has_key(attrVal): attrStr=' '+attrPair[1]+'="'+_.getitem(attrVal).absolute_url()+'"' else: attrStr=' '+attrPair[1]+'="'+attrVal+'"' return attrStr outText="