summaryrefslogtreecommitdiff
path: root/program/steps/settings
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-06-23 17:43:44 +0000
committeralecpl <alec@alec.pl>2011-06-23 17:43:44 +0000
commit25e6a0f11043537e9ea2950398f916d4db96a235 (patch)
tree4859858fec8c6f3256b09dfd0db9ba50724408d8 /program/steps/settings
parent930d385d9ec5737d438415a4496045cee37a3754 (diff)
- Add rcube_imap::mailbox_info()
Diffstat (limited to 'program/steps/settings')
-rw-r--r--program/steps/settings/func.inc45
1 files changed, 1 insertions, 44 deletions
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 72e278364..54f955282 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -788,52 +788,9 @@ function rcmail_folder_options($mailbox)
{
global $RCMAIL;
- $acl = $RCMAIL->imap->get_capability('ACL');
- $default_folders = (array) $RCMAIL->config->get('default_imap_folders');
- $delimiter = $RCMAIL->imap->get_hierarchy_delimiter();
- $namespace = $RCMAIL->imap->get_namespace();
- $options = array();
-
- // check if the folder is a namespace prefix
- if (!empty($namespace)) {
- $mbox = $mailbox . $delimiter;
- foreach ($namespace as $ns) {
- foreach ($ns as $item) {
- if ($item[0] === $mbox) {
- $options['is_root'] = true;
- break;
- }
- }
- }
- }
-
- $options['name'] = $mailbox;
- $options['options'] = $RCMAIL->imap->mailbox_options($mailbox, true);
- $options['namespace'] = $RCMAIL->imap->mailbox_namespace($mailbox);
- $options['rights'] = $acl && !$options['is_root'] ? (array)$RCMAIL->imap->my_rights($mailbox) : array();
- $options['special'] = in_array($mailbox, $default_folders);
+ $options = $RCMAIL->imap->mailbox_info($mailbox);
$options['protected'] = $options['is_root'] || ($options['special'] && $RCMAIL->config->get('protect_default_folders'));
- if (is_array($options['options'])) {
- foreach ($options['options'] as $opt) {
- $opt = strtolower($opt);
- if ($opt == '\noselect' || $opt == '\nonexistent') {
- $options['noselect'] = true;
- }
- }
- }
- else {
- $options['noselect'] = true;
- }
-
- if (!empty($options['rights'])) {
- $options['norename'] = !in_array('x', $options['rights']) &&
- (!in_array('c', $options['rights']) || !in_array('d', $options['rights']));
- if (!$options['noselect']) {
- $options['noselect'] = !in_array('r', $options['rights']);
- }
- }
-
return $options;
}