Mercurial > moin > 1.9
changeset 1978:f6262ee86e0b
EmbedObject: make mimetypes configurable
author | Reimar Bauer <rb.proj AT googlemail DOT com> |
---|---|
date | Mon, 09 Apr 2007 07:10:40 +0000 |
parents | abcbc20e8f8f |
children | 19f7c33f6530 6c58db46c2ed |
files | MoinMoin/config/multiconfig.py MoinMoin/macro/EmbedObject.py |
diffstat | 2 files changed, 24 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py Mon Apr 09 02:26:25 2007 +0200 +++ b/MoinMoin/config/multiconfig.py Mon Apr 09 07:10:40 2007 +0000 @@ -327,6 +327,29 @@ 'application/xhtml+xml', ] + mimetypes_embed = [ + 'application/x-shockwave-flash', + 'application/x-dvi', + 'application/postscript', + 'application/pdf', + 'application/ogg', + 'application/vnd.visio', + 'image/x-ms-bmp', + 'image/svg+xml', + 'image/tiff', + 'image/x-photoshop', + 'audio/mpeg', + 'audio/midi', + 'audio/x-wav', + 'video/fli', + 'video/mpeg', + 'video/quicktime', + 'video/x-msvideo', + 'chemical/x-pdb', + 'x-world/x-vrml', + ] + + navi_bar = [u'RecentChanges', u'FindPage', u'HelpContents', ] nonexist_qm = False
--- a/MoinMoin/macro/EmbedObject.py Mon Apr 09 02:26:25 2007 +0200 +++ b/MoinMoin/macro/EmbedObject.py Mon Apr 09 07:10:40 2007 +0000 @@ -147,32 +147,6 @@ self.hidden = "false" self.menu = "true" self.target = None - self.approved_mimetypes = [ - "application/x-shockwave-flash", - "application/x-dvi", - "application/postscript", - "application/pdf", - "application/ogg", - "application/vnd.visio", - - "image/x-ms-bmp", - "image/svg+xml", - "image/tiff", - "image/x-photoshop", - - "audio/mpeg", - "audio/midi", - "audio/x-wav", - - "video/fli", - "video/mpeg", - "video/quicktime", - "video/x-msvideo", - - "chemical/x-pdb", - - "x-world/x-vrml", - ] if args: args = args.split(',') @@ -199,7 +173,7 @@ return _("Not supported mimetype of file: %s" % self.target) mime_type = "%s/%s" % (mt.major, mt.minor,) - if not mime_type in self.approved_mimetypes: + if not mime_type in self.request.cfg.mimetypes_embed: return "%s%s%s" % (self.macro.formatter.sysmsg(1), self.macro.formatter.text('Embedding of object by choosen formatter not possible'), self.macro.formatter.sysmsg(0))