summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-10-25 13:20:33 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2012-10-25 13:20:33 (GMT)
commit8eda2df71ea22d802d27b766228f8c52fbc50bc4 (patch)
tree1391ce4aeab05638a3a9402e3b8dab4360a931d8
parent264504b9a30bede2f96ebecfef14ea42d906091a (diff)
downloadroundcubemail-plugins-kolab-8eda2df71ea22d802d27b766228f8c52fbc50bc4.tar.gz
Simplified default folder selection - now when private/shared annotation
is properly handled (.default is removed from shared) by kolab_storage functions
-rw-r--r--plugins/kolab_folders/kolab_folders.php23
1 files changed, 2 insertions, 21 deletions
diff --git a/plugins/kolab_folders/kolab_folders.php b/plugins/kolab_folders/kolab_folders.php
index 308d6d3..28d78bf 100644
--- a/plugins/kolab_folders/kolab_folders.php
+++ b/plugins/kolab_folders/kolab_folders.php
@@ -369,30 +369,11 @@ class kolab_folders extends rcube_plugin
return null;
}
- $type .= '.default';
- $namespace = $storage->get_namespace();
-
// get all folders of specified type
$folderdata = array_map(array('kolab_storage', 'folder_select_metadata'), $folderdata);
- $folderdata = array_intersect($folderdata, array($type));
-
- foreach ($folderdata as $folder => $data) {
- // check if folder is in personal namespace
- foreach (array('shared', 'other') as $nskey) {
- if (!empty($namespace[$nskey])) {
- foreach ($namespace[$nskey] as $ns) {
- if ($ns[0] && substr($folder, 0, strlen($ns[0])) == $ns[0]) {
- continue 3;
- }
- }
- }
- }
-
- // There can be only one default folder of specified type
- return $folder;
- }
+ $folderdata = array_intersect($folderdata, array($type.'.default'));
- return null;
+ return key($folderdata);
}
/**