summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-04-08 16:34:36 +0000
committeralecpl <alec@alec.pl>2012-04-08 16:34:36 +0000
commit1b30a710cfe7fb2917ed337c52b06bb2236e1a05 (patch)
tree80465019a2941d6fa4ea8c67cb71e1c43d2e7447 /program/steps
parent84b028ce0054a053f4aa019f311b507bb9faed08 (diff)
- Add option to delete messages instead of moving to Trash when in Junk folder (#1486686)
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/func.inc2
-rw-r--r--program/steps/mail/show.inc9
-rw-r--r--program/steps/settings/func.inc10
-rw-r--r--program/steps/settings/save_prefs.inc1
4 files changed, 19 insertions, 3 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 7d1fbaab4..8dcd37b20 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -99,6 +99,8 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') {
$OUTPUT->set_env('threads', $threading || $RCMAIL->storage->get_capability('THREAD'));
$OUTPUT->set_env('preview_pane_mark_read', $RCMAIL->config->get('preview_pane_mark_read', 0));
+ if ($CONFIG['delete_junk'])
+ $OUTPUT->set_env('delete_junk', true);
if ($CONFIG['flag_for_deletion'])
$OUTPUT->set_env('flag_for_deletion', true);
if ($CONFIG['read_when_deleted'])
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index d3b70b4ab..c6c6d9636 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -52,16 +52,19 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_GET)) {
$OUTPUT->set_env('permaurl', rcmail_url('show', array('_uid' => $MESSAGE->uid, '_mbox' => $mbox_name)));
$OUTPUT->set_env('delimiter', $RCMAIL->storage->get_hierarchy_delimiter());
$OUTPUT->set_env('mailbox', $mbox_name);
- if ($CONFIG['drafts_mbox']) {
- $OUTPUT->set_env('drafts_mailbox', $CONFIG['drafts_mbox']);
- }
// 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['drafts_mbox'])
+ $OUTPUT->set_env('drafts_mailbox', $CONFIG['drafts_mbox']);
if ($CONFIG['trash_mbox'])
$OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
+ if ($CONFIG['junk_mbox'])
+ $OUTPUT->set_env('junk_mailbox', $CONFIG['junk_mbox']);
+ if ($CONFIG['delete_junk'])
+ $OUTPUT->set_env('delete_junk', true);
if ($CONFIG['flag_for_deletion'])
$OUTPUT->set_env('flag_for_deletion', true);
if ($CONFIG['read_when_deleted'])
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index fc836ed50..48d1d5a0b 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -816,6 +816,16 @@ function rcmail_user_prefs($current=null)
);
}
+ if (!isset($no_override['delete_junk'])) {
+ $field_id = 'rcmfd_delete_junk';
+ $input_delete_junk = new html_checkbox(array('name' => '_delete_junk', 'id' => $field_id, 'value' => 1));
+
+ $blocks['main']['options']['delete_junk'] = array(
+ 'title' => html::label($field_id, Q(rcube_label('deletejunk'))),
+ 'content' => $input_delete_junk->show($config['delete_junk']?1:0),
+ );
+ }
+
// Trash purging on logout
if (!isset($no_override['logout_purge'])) {
$field_id = 'rcmfd_logout_purge';
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index 4af4a3f8f..f521f4f34 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -110,6 +110,7 @@ switch ($CURR_SECTION)
'skip_deleted' => isset($_POST['_skip_deleted']) ? TRUE : FALSE,
'flag_for_deletion' => isset($_POST['_flag_for_deletion']) ? TRUE : FALSE,
'delete_always' => isset($_POST['_delete_always']) ? TRUE : FALSE,
+ 'delete_junk' => isset($_POST['_delete_junk']) ? TRUE : FALSE,
'logout_purge' => isset($_POST['_logout_purge']) ? TRUE : FALSE,
'logout_expunge' => isset($_POST['_logout_expunge']) ? TRUE : FALSE,
);