diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-06-17 08:03:07 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-06-17 08:03:07 +0000 |
| commit | 0d5faad8d2af22388d45d33c5b21cac0d843a7a9 (patch) | |
| tree | bd55f7ce8751c4bad426aafabaed9f5549245903 /roundcubemail/program/steps/settings/folders.inc | |
| parent | d8f5ff7e62643ede6596c207510a0553cb9c7fbb (diff) | |
- Improved namespace roots handling in folder manager
git-svn-id: https://svn.roundcube.net/trunk@4860 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/settings/folders.inc')
| -rw-r--r-- | roundcubemail/program/steps/settings/folders.inc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/roundcubemail/program/steps/settings/folders.inc b/roundcubemail/program/steps/settings/folders.inc index c84f616bb..ed1fb79bf 100644 --- a/roundcubemail/program/steps/settings/folders.inc +++ b/roundcubemail/program/steps/settings/folders.inc @@ -179,7 +179,7 @@ function rcube_subscription_form($attrib) list($form_start, $form_end) = get_form_tags($attrib, 'folders'); unset($attrib['form']); - + if (!$attrib['id']) $attrib['id'] = 'rcmSubscriptionlist'; @@ -197,6 +197,7 @@ function rcube_subscription_form($attrib) $a_unsubscribed = $IMAP->list_unsubscribed(); $a_subscribed = $IMAP->list_mailboxes(); $delimiter = $IMAP->get_hierarchy_delimiter(); + $namespace = $IMAP->get_namespace(); $a_js_folders = array(); $seen = array(); $list_folders = array(); @@ -253,6 +254,7 @@ function rcube_subscription_form($attrib) $idx = $i + 1; $subscribed = in_array($folder['id'], $a_subscribed); $protected = ($CONFIG['protect_default_folders'] == true && in_array($folder['id'], $CONFIG['default_imap_folders'])); + $noselect = false; $classes = array($i%2 ? 'even' : 'odd'); $folder_js = Q($folder['id']); @@ -271,6 +273,19 @@ function rcube_subscription_form($attrib) $disabled = (($protected && $subscribed) || $noselect); + // check if the folder is a namespace prefix, then disable subscription option on it + if (!$disabled && $folder['virtual'] && $folder['level'] == 0 && !empty($namespace)) { + $fname = $folder['id'] . $delimiter; + foreach ($namespace as $ns) { + foreach ($ns as $item) { + if ($item[0] === $fname) { + $disabled = true; + break; + } + } + } + } + $table->add_row(array('id' => 'rcmrow'.$idx, 'class' => join(' ', $classes), 'foldername' => $folder['id'])); |
