summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-05-16 13:53:08 +0000
committeralecpl <alec@alec.pl>2011-05-16 13:53:08 +0000
commita509bb677ca626315d71e07afc8342a0690b6859 (patch)
treee55d28844812e713157aeeab2ed378adebd2ab05 /program
parent9b6c82fdc8e0f74a1ca0f838e710c944c5526f65 (diff)
- Add option to set default action of Forward button to "Forward as attachment"
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js11
-rw-r--r--program/steps/mail/func.inc6
-rw-r--r--program/steps/mail/show.inc2
3 files changed, 12 insertions, 7 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 3f103de65..c4aa50995 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -931,10 +931,13 @@ function rcube_webmail()
case 'forward-attachment':
case 'forward':
- var uid;
- if (uid = this.get_single_uid())
- this.goto_url('compose', '_forward_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)
- + (command == 'forward-attachment' ? '&_attachment=1' : ''), true);
+ var uid, url;
+ if (uid = this.get_single_uid()) {
+ url = '_forward_uid='+uid+'&_mbox='+urlencode(this.env.mailbox);
+ if (command == 'forward-attachment' || (!props && this.env.forward_attachment))
+ url += '&_attachment=1';
+ this.goto_url('compose', url, true);
+ }
break;
case 'print':
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 36b4c02a6..e0504e658 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -106,6 +106,7 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') {
$OUTPUT->set_env('delimiter', $IMAP->get_hierarchy_delimiter());
$OUTPUT->set_env('threading', (bool) $IMAP->threading);
$OUTPUT->set_env('threads', $IMAP->threading || $IMAP->get_capability('THREAD'));
+ $OUTPUT->set_env('preview_pane_mark_read', $RCMAIL->config->get('preview_pane_mark_read', 0));
if ($CONFIG['flag_for_deletion'])
$OUTPUT->set_env('flag_for_deletion', true);
@@ -115,9 +116,8 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') {
$OUTPUT->set_env('skip_deleted', true);
if ($CONFIG['display_next'])
$OUTPUT->set_env('display_next', true);
-
- $OUTPUT->set_env('preview_pane_mark_read', $RCMAIL->config->get('preview_pane_mark_read', 0));
-
+ if ($CONFIG['forward_attachment'])
+ $OUTPUT->set_env('forward_attachment', true);
if ($CONFIG['trash_mbox'])
$OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
if ($CONFIG['drafts_mbox'])
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 1d7a32693..8c063e8ea 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -64,6 +64,8 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_GET)) {
$OUTPUT->set_env('display_next', true);
if ($MESSAGE->headers->others['list-post'])
$OUTPUT->set_env('list_post', true);
+ if ($CONFIG['forward_attachment'])
+ $OUTPUT->set_env('forward_attachment', true);
if (!$OUTPUT->ajax_call)
$OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash',