| | |
| | | <?php |
| | | |
| | | /* |
| | | /** |
| | | +-----------------------------------------------------------------------+ |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2011, The Roundcube Dev Team | |
| | |
| | | $this->init($data); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Initializes object with IMAP command response |
| | | * |
| | |
| | | $this->raw_data = $this->parse_thread($data); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Checks the result from IMAP command |
| | | * |
| | |
| | | return $this->raw_data === null ? true : false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Checks if the result is empty |
| | | * |
| | |
| | | { |
| | | return empty($this->raw_data) ? true : false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns number of elements (threads) in the result |
| | |
| | | |
| | | return $this->meta['count']; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns number of all messages in the result |
| | |
| | | return $this->meta['messages']; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns maximum message identifier in the result |
| | | * |
| | |
| | | return $this->meta['max']; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns minimum message identifier in the result |
| | | * |
| | |
| | | } |
| | | return $this->meta['min']; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Slices data set. |
| | |
| | | $this->meta['count'] = count($data); |
| | | $this->raw_data = implode(self::SEPARATOR_ELEMENT, $data); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Filters data set. Removes threads not listed in $roots list. |
| | |
| | | $this->raw_data = ltrim($result, self::SEPARATOR_ELEMENT); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Reverts order of elements in the result |
| | | */ |
| | |
| | | |
| | | $this->raw_data = rtrim($result, self::SEPARATOR_ELEMENT); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Check if the given message ID exists in the object |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Return IDs of all messages in the result. Threaded data will be flattened. |
| | | * |
| | |
| | | return preg_split($regexp, $this->raw_data); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Return all messages in the result. |
| | | * |
| | |
| | | |
| | | return rcube_imap_generic::compressMessageSet($this->get()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Return result element at specified index (all messages, not roots) |
| | |
| | | return $data[$index]; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns response parameters e.g. MAILBOX, ORDER |
| | | * |
| | | * @param string $param Parameter name |
| | | * @param string $param Parameter name |
| | | * |
| | | * @return array|string Response parameters or parameter value |
| | | */ |
| | |
| | | |
| | | return $params; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * THREAD=REFS sorting implementation (based on provided index) |
| | |
| | | $this->raw_data = implode(self::SEPARATOR_ELEMENT, $result); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns data as tree |
| | | * |
| | |
| | | return $result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns thread depth and children data |
| | | * |
| | |
| | | return array($depth, $children); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Creates 'depth' and 'children' arrays from stored thread 'tree' data. |
| | | */ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Converts part of the raw thread into an array |
| | |
| | | |
| | | return $result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * IMAP THREAD response parser |