summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-09-20 07:32:02 (GMT)
committerThomas Bruederli <thomas@roundcube.net>2012-09-20 07:32:02 (GMT)
commitaae0f725bc6a1ab0ed6faf56d114efb2d73ff6fb (patch)
tree2c2d913236dec07ac559c4fede1312df7cf4ee40 /plugins
parent395807c424e8bc2693880d3f561e918b5673b7b8 (diff)
downloadroundcubemail-plugins-kolab-aae0f725bc6a1ab0ed6faf56d114efb2d73ff6fb.tar.gz
Make get_default_folder() work multiple annotations
Diffstat (limited to 'plugins')
-rw-r--r--plugins/kolab_folders/kolab_folders.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/kolab_folders/kolab_folders.php b/plugins/kolab_folders/kolab_folders.php
index 899620f..297c858 100644
--- a/plugins/kolab_folders/kolab_folders.php
+++ b/plugins/kolab_folders/kolab_folders.php
@@ -388,9 +388,8 @@ class kolab_folders extends rcube_plugin
$namespace = $storage->get_namespace();
// get all folders of specified type
- $folderdata = array_map('implode', $folderdata);
+ $folderdata = array_map(array($this, 'folder_select_metadata'), $folderdata);
$folderdata = array_intersect($folderdata, array($type));
- unset($folders[0]);
foreach ($folderdata as $folder => $data) {
// check if folder is in personal namespace
@@ -412,6 +411,14 @@ class kolab_folders extends rcube_plugin
}
/**
+ * Callback for array_map to select the correct annotation value
+ */
+ private function folder_select_metadata($types)
+ {
+ return $types[kolab_storage::CTYPE_KEY_PRIVATE] ?: $types[kolab_storage::CTYPE_KEY];
+ }
+
+ /**
* Returns CSS class name for specified folder type
*
* @param string $type Folder type