summaryrefslogtreecommitdiff
path: root/program/include/rcmail.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-03-22 14:55:12 +0100
committerAleksander Machniak <alec@alec.pl>2014-03-22 14:55:12 +0100
commit1597c8a0c2a8a35fa19ad710d0518ea30c7244c5 (patch)
treed0cce197edd306520d90be3e7101f118c052a031 /program/include/rcmail.php
parentfbe5bc9ba2ad4960994885e84a118d0aaff4431f (diff)
Make sure parent folder selector always contains parent folder
of current folder, even if it does not exist
Diffstat (limited to 'program/include/rcmail.php')
-rw-r--r--program/include/rcmail.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index d1b544135..4aa3dedad 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -1355,12 +1355,31 @@ class rcmail extends rcube
$delimiter = $storage->get_hierarchy_delimiter();
- foreach ($list as $folder) {
- if (empty($p['exceptions']) || !in_array($folder, $p['exceptions'])) {
- $this->build_folder_tree($a_mailboxes, $folder, $delimiter);
+ if (!empty($p['exceptions'])) {
+ $list = array_diff($list, (array) $p['exceptions']);
+ }
+
+ if (!empty($p['additional'])) {
+ foreach ($p['additional'] as $add_folder) {
+ $add_items = explode($delimiter, $add_folder);
+ $folder = '';
+ while (count($add_items)) {
+ $folder .= array_shift($add_items);
+
+ // @TODO: sorting
+ if (!in_array($folder, $list)) {
+ $list[] = $folder;
+ }
+
+ $folder .= $delimiter;
+ }
}
}
+ foreach ($list as $folder) {
+ $this->build_folder_tree($a_mailboxes, $folder, $delimiter);
+ }
+
$select = new html_select($p);
if ($p['noselection']) {