Move getTitle() into the namespace handler.
authorGunnar Wrobel <p@rdus.de>
Thu, 11 Mar 2010 20:57:32 +0000 (21:57 +0100)
committerGunnar Wrobel <wrobel@temple.(none)>
Thu, 11 Mar 2010 21:35:05 +0000 (22:35 +0100)
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Namespace.php

index 19e5901..bfea567 100644 (file)
@@ -544,12 +544,7 @@ class Horde_Kolab_Storage_Folder
     function getTitle()
     {
         if (!isset($this->_title) && isset($this->name)) {
-            $title = $this->name;
-            if (substr($title, 0, 6) == 'INBOX/') {
-                $title = substr($title, 6);
-            }
-            $title = str_replace('/', ':', $title);
-            $this->_title = Horde_String::convertCharset($title, 'UTF7-IMAP');
+            $this->_title = $this->_namespace->getTitle($this->name);
         }
         return $this->_title;
     }
index 6411fc6..0401a23 100644 (file)
  */
 class Horde_Kolab_Storage_Namespace
 {
+
+    /**
+     * Return the title of a folder.
+     *
+     * @param string $name The name of the folder.
+     */
+    public function getTitle($name)
+    {
+        if (substr($name, 0, 6) == 'INBOX/') {
+            $name = substr($name, 6);
+        }
+        $name = str_replace('/', ':', $name);
+        return Horde_String::convertCharset($name, 'UTF7-IMAP');
+    }
 }
\ No newline at end of file