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
27943ba6
Commit
27943ba6
authored
Mar 11, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed Image View tab to include tabs.
Added getSize and getContentType.
parent
888f1f78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
lib/python/OFS/Image.py
lib/python/OFS/Image.py
+20
-14
No files found.
lib/python/OFS/Image.py
View file @
27943ba6
"""Image object"""
__version__
=
'$Revision: 1.3
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
3
$'
[
11
:
-
2
]
import
Globals
from
Globals
import
HTMLFile
,
MessageDialog
...
...
@@ -26,25 +26,17 @@ class File(Persistent,Implicit,RoleManager,Item_w__name__):
manage_uploadForm
=
HTMLFile
(
'imageUpload'
,
globals
(),
Kind
=
'File'
,
kind
=
'file'
)
manage
=
manage_main
=
manage_editForm
manage_options
=
({
'label'
:
'Edit'
,
'action'
:
'manage_main'
,
'target'
:
'manage_main'
,
},
{
'label'
:
'Upload'
,
'action'
:
'manage_uploadForm'
,
'target'
:
'manage_main'
,
},
{
'label'
:
'View'
,
'action'
:
'index_html'
,
'target'
:
'manage_main'
,
},
{
'label'
:
'Security'
,
'action'
:
'manage_access'
,
'target'
:
'manage_main'
,
},
manage_options
=
({
'label'
:
'Edit'
,
'action'
:
'manage_main'
},
{
'label'
:
'Upload'
,
'action'
:
'manage_uploadForm'
},
{
'label'
:
'View'
,
'action'
:
'view_image_or_file'
},
{
'label'
:
'Security'
,
'action'
:
'manage_access'
},
)
__ac_permissions__
=
(
(
'View management screens'
,
[
'manage'
,
'manage_tabs'
,
'manage_uploadForm'
]),
(
'Change permissions'
,
[
'manage_access'
]),
(
'Change/upload data'
,
[
'manage_edit'
,
'manage_upload'
,
'PUT'
]),
(
'View'
,
[
'index_html'
,]),
(
'View'
,
[
'index_html'
,
'view_image_or_file'
,
'getSize'
,
'getContentType'
]),
(
'Shared permission'
,
[
''
,]),
)
...
...
@@ -77,6 +69,8 @@ class File(Persistent,Implicit,RoleManager,Item_w__name__):
RESPONSE
[
'content-type'
]
=
self
.
content_type
return
self
.
data
def
view_image_or_file
(
self
,
RESPONSE
):
return
self
.
index_html
(
RESPONSE
)
def
manage_edit
(
self
,
title
,
content_type
,
REQUEST
=
None
):
""" """
self
.
title
=
title
...
...
@@ -113,6 +107,17 @@ class File(Persistent,Implicit,RoleManager,Item_w__name__):
if
type
:
self
.
content_type
=
type
except
KeyError
:
pass
def
getSize
(
self
):
"""Get the size of a file or image
"""
return
len
(
self
.
data
)
def
getContentType
(
self
):
"""Get the content type of a file or image
"""
return
self
.
content_type
def
size
(
self
):
return
len
(
self
.
data
)
def
__str__
(
self
):
return
str
(
self
.
data
)
def
__len__
(
self
):
return
1
...
...
@@ -129,6 +134,7 @@ class Image(File):
icon
=
'p_/image'
manage_editForm
=
HTMLFile
(
'imageEdit'
,
globals
(),
Kind
=
'Image'
,
kind
=
'image'
)
view_image_or_file
=
HTMLFile
(
'imageView'
,
globals
())
manage_uploadForm
=
HTMLFile
(
'imageUpload'
,
globals
(),
Kind
=
'Image'
,
kind
=
'image'
)
manage
=
manage_main
=
manage_editForm
...
...
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