Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
85d2a5f1
Commit
85d2a5f1
authored
Dec 10, 2013
by
Matthew Wilkes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LP #1103583: tag() should not be publishable
parent
90360c44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
src/OFS/Image.py
src/OFS/Image.py
+13
-15
No files found.
src/OFS/Image.py
View file @
85d2a5f1
...
...
@@ -835,21 +835,19 @@ class Image(File):
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment