Use kolab_storage::folders_typedata() to list folder types

This commit is contained in:
Aleksander Machniak 2013-07-09 19:45:54 +02:00
parent c0a005b204
commit 8ecc1d271e
2 changed files with 1 additions and 25 deletions

View file

@ -36,7 +36,6 @@ class kolab_activesync extends rcube_plugin
const ROOT_MAILBOX = 'INBOX';
const ASYNC_KEY = '/private/vendor/kolab/activesync';
const CTYPE_KEY = '/shared/vendor/kolab/folder-type';
/**
@ -191,29 +190,6 @@ class kolab_activesync extends rcube_plugin
return $storage->list_folders();
}
/**
* Returns list of folders with assigned type
*
* @return array List of folder types indexed by folder name
*/
public function list_types()
{
if ($this->folder_types === null) {
$storage = $this->rc->get_storage();
$folderdata = $storage->get_metadata('*', self::CTYPE_KEY);
$this->folder_types = array();
foreach ($folderdata as $folder => $data) {
if ($data[self::CTYPE_KEY]) {
$this->folder_types[$folder] = $data[self::CTYPE_KEY];
}
}
}
return $this->folder_types;
}
/**
* List known devices
*

View file

@ -107,7 +107,7 @@ class kolab_activesync_ui
// group folders by type (show only known types)
$folder_groups = array('mail' => array(), 'contact' => array(), 'event' => array(), 'task' => array());
$folder_types = $this->plugin->list_types();
$folder_types = kolab_storage::folders_typedata();
$imei = $this->device['_id'];
$subscribed = array();