Support listing folder types.
authorGunnar Wrobel <p@rdus.de>
Mon, 27 Dec 2010 21:11:53 +0000 (22:11 +0100)
committerGunnar Wrobel <p@rdus.de>
Tue, 4 Jan 2011 07:54:15 +0000 (08:54 +0100)
framework/Kolab_Storage/lib/Horde/Kolab/Storage/List.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/List/Base.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/List/Decorator/Log.php

index fa6f0fd..d2eb68b 100644 (file)
@@ -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();
 }
index 805e4df..43eb0b9 100644 (file)
@@ -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
index cfd77bb..5bcc65b 100644 (file)
@@ -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