summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_result_multifolder.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-05-15 13:57:18 +0200
committerAleksander Machniak <alec@alec.pl>2014-05-15 13:57:18 +0200
commit47a7833aca96a263068eed53f9471a3699ef257b (patch)
tree2f22545e2c005f115d99281130f3e81be8299187 /program/lib/Roundcube/rcube_result_multifolder.php
parent963499a17e98cdab4a6e872a711ce9badb8c3b0b (diff)
CS fixes
Diffstat (limited to 'program/lib/Roundcube/rcube_result_multifolder.php')
-rw-r--r--program/lib/Roundcube/rcube_result_multifolder.php27
1 files changed, 16 insertions, 11 deletions
diff --git a/program/lib/Roundcube/rcube_result_multifolder.php b/program/lib/Roundcube/rcube_result_multifolder.php
index 4bbd2188d..786ee85f6 100644
--- a/program/lib/Roundcube/rcube_result_multifolder.php
+++ b/program/lib/Roundcube/rcube_result_multifolder.php
@@ -26,16 +26,16 @@
*/
class rcube_result_multifolder
{
- public $multi = true;
- public $sets = array();
+ public $multi = true;
+ public $sets = array();
public $incomplete = false;
public $folder;
- protected $meta = array();
- protected $index = array();
+ protected $meta = array();
+ protected $index = array();
protected $folders = array();
+ protected $order = 'ASC';
protected $sorting;
- protected $order = 'ASC';
/**
@@ -44,7 +44,7 @@ class rcube_result_multifolder
public function __construct($folders = array())
{
$this->folders = $folders;
- $this->meta = array('count' => 0);
+ $this->meta = array('count' => 0);
}
@@ -74,7 +74,8 @@ class rcube_result_multifolder
// append UIDs to global index
$folder = $result->get_parameters('MAILBOX');
- $index = array_map(function($uid) use ($folder) { return $uid . '-' . $folder; }, $result->get());
+ $index = array_map(function($uid) use ($folder) { return $uid . '-' . $folder; }, $result->get());
+
$this->index = array_merge($this->index, $index);
}
@@ -89,7 +90,7 @@ class rcube_result_multifolder
}
$this->sorting = $sort_field;
- $this->order = $sort_order;
+ $this->order = $sort_order;
}
/**
@@ -150,8 +151,10 @@ class rcube_result_multifolder
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());
+ $index = array_map(function($uid) use ($folder) { return $uid . '-' . $folder; }, $set->get());
+
$this->index = array_merge($this->index, $index);
}
}
@@ -171,6 +174,7 @@ class rcube_result_multifolder
if (!empty($this->folder)) {
$msgid .= '-' . $this->folder;
}
+
return array_search($msgid, $this->index);
}
@@ -188,6 +192,7 @@ class rcube_result_multifolder
if ($set->get_parameters('MAILBOX') == $folder) {
$set->filter($ids);
}
+
$this->meta['count'] += $set->count();
}
}
@@ -267,8 +272,8 @@ class rcube_result_multifolder
public function get_parameters($param=null)
{
$params = array(
- 'SORT' => $this->sorting,
- 'ORDER' => $this->order,
+ 'SORT' => $this->sorting,
+ 'ORDER' => $this->order,
'MAILBOX' => $this->folders,
);