Commit c1114aac authored by 's avatar

Merge fix to allow Files to be index_html (default document)

parent ece6dc16
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""Image object""" """Image object"""
__version__='$Revision: 1.113 $'[11:-2] __version__='$Revision: 1.114 $'[11:-2]
import Globals, string, struct, content_types import Globals, string, struct, content_types
from OFS.content_types import guess_content_type from OFS.content_types import guess_content_type
...@@ -166,7 +166,7 @@ class File(Persistent,Implicit,PropertyManager, ...@@ -166,7 +166,7 @@ class File(Persistent,Implicit,PropertyManager,
('manage_edit','manage_upload','PUT')), ('manage_edit','manage_upload','PUT')),
('View', ('View',
('index_html', 'view_image_or_file', 'get_size', ('index_html', 'view_image_or_file', 'get_size',
'getContentType', '')), 'getContentType', '__call__', '')),
('FTP access', ('FTP access',
('manage_FTPstat','manage_FTPget','manage_FTPlist')), ('manage_FTPstat','manage_FTPget','manage_FTPlist')),
('Delete objects', ('Delete objects',
...@@ -239,7 +239,13 @@ class File(Persistent,Implicit,PropertyManager, ...@@ -239,7 +239,13 @@ class File(Persistent,Implicit,PropertyManager,
data=data.next data=data.next
return '' return ''
def __call__(self):
# allow publisher to call the object directly - this lets File
# and Image objects act as the default document if they want.
request=self.REQUEST
response=request.RESPONSE
return self.index_html(request, response)
def view_image_or_file(self, URL1): def view_image_or_file(self, URL1):
""" """
...@@ -448,7 +454,7 @@ class Image(File): ...@@ -448,7 +454,7 @@ class Image(File):
('manage_edit','manage_upload','PUT')), ('manage_edit','manage_upload','PUT')),
('View', ('View',
('index_html', 'tag', 'view_image_or_file', 'get_size', ('index_html', 'tag', 'view_image_or_file', 'get_size',
'getContentType', '')), 'getContentType', '__call__', '')),
('FTP access', ('FTP access',
('manage_FTPstat','manage_FTPget','manage_FTPlist')), ('manage_FTPstat','manage_FTPget','manage_FTPlist')),
('Delete objects', ('Delete objects',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment