Skip to content

Commit

Permalink
LP #1103583: tag() should not be publishable
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewWilkes committed Dec 10, 2013
1 parent 90360c4 commit 85d2a5f
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/OFS/Image.py
Expand Up @@ -835,21 +835,19 @@ def __str__(self):
security.declareProtected(View, 'tag')
def tag(self, height=None, width=None, alt=None,
scale=0, xscale=0, yscale=0, css_class=None, title=None, **args):
"""
Generate an HTML IMG tag for this image, with customization.
Arguments to self.tag() can be any valid attributes of an IMG tag.
'src' will always be an absolute pathname, to prevent redundant
downloading of images. Defaults are applied intelligently for
'height', 'width', and 'alt'. If specified, the 'scale', 'xscale',
and 'yscale' keyword arguments will be used to automatically adjust
the output height and width values of the image tag.
Since 'class' is a Python reserved word, it cannot be passed in
directly in keyword arguments which is a problem if you are
trying to use 'tag()' to include a CSS class. The tag() method
will accept a 'css_class' argument that will be converted to
'class' in the output tag to work around this.
"""
# Generate an HTML IMG tag for this image, with customization.
# Arguments to self.tag() can be any valid attributes of an IMG tag.
# 'src' will always be an absolute pathname, to prevent redundant
# downloading of images. Defaults are applied intelligently for
# 'height', 'width', and 'alt'. If specified, the 'scale', 'xscale',
# and 'yscale' keyword arguments will be used to automatically adjust
# the output height and width values of the image tag.
#
# Since 'class' is a Python reserved word, it cannot be passed in
# directly in keyword arguments which is a problem if you are
# trying to use 'tag()' to include a CSS class. The tag() method
# will accept a 'css_class' argument that will be converted to
# 'class' in the output tag to work around this.
if height is None: height=self.height
if width is None: width=self.width

Expand Down

0 comments on commit 85d2a5f

Please sign in to comment.