Back to index

plone3  3.1.7
version_image_tag.py
Go to the documentation of this file.
00001 ## Script (Python) "version_image_tag"
00002 ##bind container=container
00003 ##bind context=context
00004 ##bind namespace=
00005 ##bind script=script
00006 ##bind subpath=traverse_subpath
00007 ##parameters=here_url, version_id=None
00008 ##title=Image tag for specific version
00009 ##
00010 obj = context.portal_repository.retrieve(context, version_id).object
00011 working_copy_tag = obj.tag()
00012 
00013 # XXX Does someone know a less ugly way to do this?
00014 altPos = working_copy_tag.find("alt=")
00015 tag = '<img src="%s/file_download_version?version_id=%s" %s' % \
00016       (here_url, version_id, working_copy_tag[altPos:])
00017 
00018 return tag