Simplified default folder selection - now when private/shared annotation
is properly handled (.default is removed from shared) by kolab_storage functions
This commit is contained in:
parent
264504b9a3
commit
8eda2df71e
1 changed files with 2 additions and 21 deletions
|
@ -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));
|
||||
$folderdata = array_intersect($folderdata, array($type.'.default'));
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
return null;
|
||||
return key($folderdata);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue