diff options
Diffstat (limited to 'plugins/archive')
-rw-r--r-- | plugins/archive/archive.js | 12 | ||||
-rw-r--r-- | plugins/archive/archive.php | 10 |
2 files changed, 11 insertions, 11 deletions
diff --git a/plugins/archive/archive.js b/plugins/archive/archive.js index cf44b74d4..f9fc7d630 100644 --- a/plugins/archive/archive.js +++ b/plugins/archive/archive.js @@ -1,6 +1,6 @@ /* * Archive plugin script - * @version 2.0 + * @version 2.1 */ function rcmail_archive(prop) @@ -15,15 +15,7 @@ function rcmail_archive(prop) } else { // let the server sort the messages to the according subfolders - var post_data = { _uid: rcmail.env.uid ? rcmail.env.uid : rcmail.message_list.get_selection().join(','), _mbox: rcmail.env.mailbox }; - - if (rcmail.env.display_next && rcmail.env.next_uid) - post_data._next_uid = rcmail.env.next_uid; - - if (rcmail.env.action) - post_data._from = rcmail.env.action; - - rcmail.http_post('plugin.move2archive', post_data); + rcmail.http_post('plugin.move2archive', rcmail.selection_post_data()); } } } diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php index 291ef1370..5ad197ac1 100644 --- a/plugins/archive/archive.php +++ b/plugins/archive/archive.php @@ -121,8 +121,16 @@ class archive extends rcube_plugin $storage->set_folder(($current_mbox = rcube_utils::get_input_value('_mbox', RCUBE_INPUT_POST))); $result = array('reload' => false, 'update' => false, 'errors' => array()); - $uids = explode(',', rcube_utils::get_input_value('_uid', RCUBE_INPUT_POST)); $folders = array(); + $uids = rcube_utils::get_input_value('_uid', RCUBE_INPUT_POST); + + if ($uids == '*') { + $index = $storage->index(null, rcmail_sort_column(), rcmail_sort_order()); + $uids = $index->get(); + } + else { + $uids = explode(',', $uids); + } foreach ($uids as $uid) { if (!$archive_folder || !($message = $rcmail->storage->get_message($uid))) { |