diff options
author | thomascube <thomas@roundcube.net> | 2011-08-29 17:30:11 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2011-08-29 17:30:11 +0000 |
commit | f7b58afb94ba5da1dd7b1e2fa7b67c398b4d3d1e (patch) | |
tree | fd483ae8810ec93d86ee34b05f8c7d02dccf1c04 /program | |
parent | d78771ad3ce75dc7eb5bb43f822be0b0ab8d6db2 (diff) |
Make list of mimetypes that open in preview window configurable (#1487625)
Diffstat (limited to 'program')
-rw-r--r-- | program/js/app.js | 7 | ||||
-rw-r--r-- | program/steps/mail/show.inc | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/program/js/app.js b/program/js/app.js index 2763b120c..b12d5c219 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -41,11 +41,6 @@ function rcube_webmail() this.identifier_expr = new RegExp('[^0-9a-z\-_]', 'gi'); - // mimetypes supported by the browser (default settings) - this.mimetypes = new Array('text/plain', 'text/html', 'text/xml', - 'image/jpeg', 'image/gif', 'image/png', - 'application/x-javascript', 'application/pdf', 'application/x-shockwave-flash'); - // default environment vars this.env.keep_alive = 60; // seconds this.env.request_timeout = 180; // seconds @@ -749,7 +744,7 @@ function rcube_webmail() var qstring = '_mbox='+urlencode(this.env.mailbox)+'&_uid='+this.env.uid+'&_part='+props.part; // open attachment in frame if it's of a supported mimetype - if (this.env.uid && props.mimetype && $.inArray(props.mimetype, this.mimetypes)>=0) { + if (this.env.uid && props.mimetype && this.env.mimetypes && $.inArray(props.mimetype, this.env.mimetypes)>=0) { if (props.mimetype == 'text/html') qstring += '&_safe=1'; this.attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment'); diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc index 3c2fa238e..1472a9e61 100644 --- a/program/steps/mail/show.inc +++ b/program/steps/mail/show.inc @@ -52,6 +52,10 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_GET)) { $OUTPUT->set_env('delimiter', $IMAP->get_hierarchy_delimiter()); $OUTPUT->set_env('mailbox', $mbox_name); + // mimetypes supported by the browser (default settings) + $mimetypes = $RCMAIL->config->get('client_mimetypes', 'text/plain,text/html,text/xml,image/jpeg,image/gif,image/png,application/x-javascript,application/pdf,application/x-shockwave-flash'); + $OUTPUT->set_env('mimetypes', is_string($mimetypes) ? explode(',', $mimetypes) : (array)$mimetypes); + if ($CONFIG['trash_mbox']) $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']); if ($CONFIG['flag_for_deletion']) |