Make multi-folder message identifiers work with folders containing commas
| | |
| | | $_uid = $uids ?: rcube_utils::get_input_value('_uid', RCUBE_INPUT_GPC); |
| | | $_mbox = $mbox ?: (string)rcube_utils::get_input_value('_mbox', RCUBE_INPUT_GPC); |
| | | |
| | | if (is_array($uid)) { |
| | | return $uid; |
| | | // already a hash array |
| | | if (is_array($_uid) && !isset($_uid[0])) { |
| | | return $_uid; |
| | | } |
| | | |
| | | $result = array(); |
| | |
| | | } |
| | | } |
| | | else { |
| | | if (is_string($_uid)) |
| | | $_uid = explode(',', $_uid); |
| | | |
| | | // create a per-folder UIDs array |
| | | foreach (explode(',', $_uid) as $uid) { |
| | | foreach ((array)$_uid as $uid) { |
| | | list($uid, $mbox) = explode('-', $uid, 2); |
| | | if (empty($mbox)) |
| | | $mbox = $_mbox; |
| | |
| | | var icn_src, uid, i, len, |
| | | rows = this.message_list ? this.message_list.rows : {}; |
| | | |
| | | if (typeof uids == 'string') |
| | | uids = String(uids).split(','); |
| | | |
| | | for (i=0, len=uids.length; i<len; i++) { |
| | |
| | | // with select_all mode checking |
| | | this.uids_to_list = function(uids) |
| | | { |
| | | return this.select_all_mode ? '*' : uids.join(','); |
| | | return this.select_all_mode ? '*' : (uids.length <= 1 ? uids.join(',') : uids); |
| | | }; |
| | | |
| | | // Sets title of the delete button |
| | |
| | | } |
| | | |
| | | // decode combined UID-folder identifier |
| | | if (preg_match('/^\d+-[^,]+$/', $uid)) { |
| | | if (preg_match('/^\d+-.+/', $uid)) { |
| | | list($uid, $folder) = explode('-', $uid, 2); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // decode combined UID-folder identifier |
| | | if (preg_match('/^\d+-[^,]+$/', $uid)) { |
| | | if (preg_match('/^\d+-.+/', $uid)) { |
| | | list($uid, $folder) = explode('-', $uid, 2); |
| | | } |
| | | |
| | |
| | | function __construct($uid, $folder = null) |
| | | { |
| | | // decode combined UID-folder identifier |
| | | if (preg_match('/^\d+-[^,]+$/', $uid)) { |
| | | if (preg_match('/^\d+-.+/', $uid)) { |
| | | list($uid, $folder) = explode('-', $uid, 2); |
| | | } |
| | | |
| | |
| | | | program/steps/mail/copy.inc | |
| | | | | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2013, The Roundcube Dev Team | |
| | | | Copyright (C) 2005-2014, The Roundcube Dev Team | |
| | | | | |
| | | | Licensed under the GNU General Public License version 3 or | |
| | | | any later version with exceptions for skins & plugins. | |
| | |
| | | $target = rcube_utils::get_input_value('_target_mbox', rcube_utils::INPUT_POST, true); |
| | | |
| | | foreach (rcmail::get_uids() as $mbox => $uids) { |
| | | if ($mbox == $target) |
| | | $copied++; |
| | | else |
| | | $copied += (int)$RCMAIL->storage->copy_message($uids, $target, $mbox); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // remove mbox part from _uid |
| | | if (($_uid = get_input_value('_uid', RCUBE_INPUT_GPC)) && preg_match('/^\d+-[^,]+$/', $_uid)) { |
| | | if (($_uid = rcube_utils::get_input_value('_uid', RCUBE_INPUT_GPC)) && !is_array($_uid) && preg_match('/^\d+-.+/', $_uid)) { |
| | | list($_uid, $mbox) = explode('-', $_uid, 2); |
| | | if (isset($_GET['_uid'])) $_GET['_uid'] = $_uid; |
| | | if (isset($_POST['_uid'])) $_POST['_uid'] = $_uid; |
| | |
| | | |
| | | if ($flag == 'DELETED' && $read_deleted && !empty($_POST['_ruid'])) { |
| | | $ruids = rcube_utils::get_input_value('_ruid', rcube_utils::INPUT_POST); |
| | | $read = $RCMAIL->storage->set_flag($ruids, 'SEEN'); |
| | | foreach (rcmail::get_uids($ruids) as $mbox => $uids) { |
| | | $read += (int)$RCMAIL->storage->set_flag($uids, 'SEEN', $mbox); |
| | | } |
| | | |
| | | if ($read && !$skip_deleted) { |
| | | $OUTPUT->command('flag_deleted_as_read', $ruids); |