From 6bb4f350919bd4f7e759ea989c17d369b4b6fcd4 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Wed, 14 Mar 2012 16:42:53 +0100 Subject: [PATCH] new options for resources: suppress external editing, do not normalize filename on download --- browser/common.py | 2 ++ browser/resource.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/browser/common.py b/browser/common.py index 1e400cb..e96c7ac 100644 --- a/browser/common.py +++ b/browser/common.py @@ -671,6 +671,8 @@ class BaseView(GenericView, I18NView): @Lazy def xeditable(self): + if self.typeOptions('no_external_edit'): + return False ct = getattr(self.context, 'contentType', '') if not ct or ct in ('application/pdf', 'application/x-pdf'): return False diff --git a/browser/resource.py b/browser/resource.py index 7d41259..e2a9816 100644 --- a/browser/resource.py +++ b/browser/resource.py @@ -207,7 +207,8 @@ class ResourceView(BaseView): data = context.data if useAttachment: filename = adapted(self.context).localFilename or getName(self.context) - filename = NameChooser(getParent(self.context)).normalizeName(filename) + if not self.typeOptions('no_normalize_download_filename'): + filename = NameChooser(getParent(self.context)).normalizeName(filename) response.setHeader('Content-Disposition', 'attachment; filename=%s' % filename) response.setHeader('Content-Length', len(data))