| | |
| | | }; |
| | | |
| | | // build URL params for search |
| | | this.search_params = function(search, filter, smods) |
| | | this.search_params = function(search, filter) |
| | | { |
| | | var n, url = {}, mods_arr = [], |
| | | mods = this.env.search_mods, |
| | |
| | | if (search) { |
| | | url._q = search; |
| | | |
| | | if (!smods && mods && this.message_list) |
| | | if (mods && this.message_list) |
| | | mods = mods[mbox] || mods['*']; |
| | | |
| | | if (mods) { |
| | |
| | | $results->add($result); |
| | | } |
| | | else { |
| | | $job = new rcube_imap_search_job($folder, $str, $charset, $sort_field, $threading); |
| | | $search = is_array($str) && $str[$folder] ? $str[$folder] : $str; |
| | | $job = new rcube_imap_search_job($folder, $search, $charset, $sort_field, $threading); |
| | | $job->worker = $this; |
| | | $this->jobs[] = $job; |
| | | } |
| | |
| | | { |
| | | $criteria = $this->search; |
| | | $charset = $this->charset; |
| | | |
| | | $imap = $this->worker->get_imap(); |
| | | |
| | | if (!$imap->connected()) { |
| | |
| | | { |
| | | return $this->result; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | protected $meta = array(); |
| | | protected $index = array(); |
| | | protected $folders = array(); |
| | | protected $sorting; |
| | | protected $order = 'ASC'; |
| | | protected $sorting; |
| | | |
| | | |
| | | /** |
| | |
| | | // append UIDs to global index |
| | | $folder = $result->get_parameters('MAILBOX'); |
| | | $index = array_map(function($uid) use ($folder) { return $uid . '-' . $folder; }, $result->get()); |
| | | |
| | | $this->index = array_merge($this->index, $index); |
| | | } |
| | | |
| | |
| | | if ($this->order != $set->get_parameters('ORDER')) { |
| | | $set->revert(); |
| | | } |
| | | |
| | | $folder = $set->get_parameters('MAILBOX'); |
| | | $index = array_map(function($uid) use ($folder) { return $uid . '-' . $folder; }, $set->get()); |
| | | |
| | | $this->index = array_merge($this->index, $index); |
| | | } |
| | | } |
| | |
| | | if (!empty($this->folder)) { |
| | | $msgid .= '-' . $this->folder; |
| | | } |
| | | |
| | | return array_search($msgid, $this->index); |
| | | } |
| | | |
| | |
| | | if ($set->get_parameters('MAILBOX') == $folder) { |
| | | $set->filter($ids); |
| | | } |
| | | |
| | | $this->meta['count'] += $set->count(); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Get connection/class option |
| | | * |
| | | * @param string $name Option name |
| | | * |
| | | * @param mixed Option value |
| | | */ |
| | | public function get_option($name) |
| | | { |
| | | return $this->options[$name]; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Activate/deactivate debug mode. |
| | | * |
| | | * @param boolean $dbg True if conversation with the server should be logged |