From 2ba401330d34fbfa4ef58909a2ff359deafc6091 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Mon, 27 Dec 2010 22:11:53 +0100 Subject: [PATCH] Support listing folder types. --- framework/Kolab_Storage/lib/Horde/Kolab/Storage/List.php | 7 +++++++ .../Kolab_Storage/lib/Horde/Kolab/Storage/List/Base.php | 13 +++++++++++++ .../lib/Horde/Kolab/Storage/List/Decorator/Log.php | 16 ++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/List.php b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/List.php index fa6f0fd5d..d2eb68bed 100644 --- a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/List.php +++ b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/List.php @@ -34,4 +34,11 @@ interface Horde_Kolab_Storage_List */ public function listFolders(); + /** + * Returns the folder types as associative array. + * + * @return array The list folder types with the folder names as key and the + * type as values. + */ + public function listTypes(); } diff --git a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/List/Base.php b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/List/Base.php index 805e4df0d..43eb0b947 100644 --- a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/List/Base.php +++ b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/List/Base.php @@ -54,4 +54,17 @@ implements Horde_Kolab_Storage_List { return $this->_driver->getMailboxes(); } + + /** + * Returns the folder types as associative array. + * + * @return array The list folder types with the folder names as key and the + * type as values. + */ + public function listTypes() + { + return $this->_driver->listAnnotation( + '/shared/vendor/kolab/folder-type' + ); + } } \ No newline at end of file diff --git a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/List/Decorator/Log.php b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/List/Decorator/Log.php index cfd77bbf5..5bcc65b75 100644 --- a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/List/Decorator/Log.php +++ b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/List/Decorator/Log.php @@ -71,4 +71,20 @@ implements Horde_Kolab_Storage_List ); return $result; } + + /** + * Returns the folder types as associative array. + * + * @return array The list folder types with the folder names as key and the + * type as values. + */ + public function listTypes() + { + $this->_logger->info('Listing folder types.'); + $result = $this->_list->listTypes(); + $this->_logger->info( + sprintf('List contained %s folders and types.', count($result)) + ); + return $result; + } } \ No newline at end of file -- 2.11.0