summaryrefslogtreecommitdiff
path: root/program/steps/settings/folders.inc
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-07-09 18:45:38 +0200
committerAleksander Machniak <alec@alec.pl>2013-07-09 18:45:38 +0200
commite89d8f1fec3743e9ee1018d3bab1a375ab79cebf (patch)
tree5d4077a933c9309d4420e719f216c27b7f42c229 /program/steps/settings/folders.inc
parentd3d1e38d7266106baf2bf2256a568691f3e55220 (diff)
Performance fix: Do not ask for folder attributes if we know that folder do not exists
Diffstat (limited to 'program/steps/settings/folders.inc')
-rw-r--r--program/steps/settings/folders.inc18
1 files changed, 10 insertions, 8 deletions
diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc
index 34a72dd95..e2a3f8aaf 100644
--- a/program/steps/settings/folders.inc
+++ b/program/steps/settings/folders.inc
@@ -232,16 +232,16 @@ function rcube_subscription_form($attrib)
// add any necessary "virtual" parent folders
if ($parent_folder && !isset($seen[$parent_folder])) {
for ($i=1; $i<=$level; $i++) {
- $ancestor_folder = join($delimiter, array_slice($foldersplit, 0, $i));
- if ($ancestor_folder && !$seen[$ancestor_folder]++) {
- $ancestor_name = rcube_charset_convert($foldersplit[$i-1], 'UTF7-IMAP');
- $list_folders[] = array(
+ $ancestor_folder = join($delimiter, array_slice($foldersplit, 0, $i));
+ if ($ancestor_folder && !$seen[$ancestor_folder]++) {
+ $ancestor_name = rcube_charset_convert($foldersplit[$i-1], 'UTF7-IMAP');
+ $list_folders[] = array(
'id' => $ancestor_folder,
'name' => $ancestor_name,
'level' => $i-1,
'virtual' => true,
);
- }
+ }
}
}
@@ -291,9 +291,11 @@ function rcube_subscription_form($attrib)
$classes[] = 'virtual';
}
- if (!$protected) {
- $attrs = $STORAGE->folder_attributes($folder['id']);
- $noselect = in_array('\\Noselect', $attrs);
+ // Check \Noselect flag (of existing folder)
+ if (!$protected && in_array($folder['id'], $a_unsubscribed)) {
+ $attrs = $STORAGE->folder_attributes($folder['id']);
+ $noselect = in_array('\\Noselect', $attrs);
+ }
}
$disabled = (($protected && $subscribed) || $noselect);