Back to index

plone3  3.1.7
image_to_html.py
Go to the documentation of this file.
00001 from Products.PortalTransforms.interfaces import itransform
00002 
00003 class image_to_html:
00004     __implements__ = itransform
00005 
00006     __name__  = "image_to_html"
00007     inputs    = ('image/*', )
00008     output   = 'text/html'
00009 
00010     def name(self):
00011         return self.__name__
00012 
00013     def convert(self, data, cache, **kwargs):
00014         imageName = kwargs.get("image")
00015         cache.setData('<img src="%s"/>' %imageName)
00016         return cache