Use Horde_String::abbreviate()
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 28 Jan 2010 20:56:22 +0000 (13:56 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 28 Jan 2010 20:56:22 +0000 (13:56 -0700)
imp/lib/Folder.php

index 79fb49f..cf31ffc 100644 (file)
@@ -135,11 +135,8 @@ class IMP_Folder
                 continue;
             }
 
-            $abbrev = $label = str_repeat(' ', 2 * $ob['c']) . $ob['l'];
-            if (strlen($abbrev) > 26) {
-                $abbrev = Horde_String::substr($abbrev, 0, 10) . '...' . Horde_String::substr($abbrev, -13, 13);
-            }
-            $list[$ob['v']] = array('val' => $imaptree->isContainer($ob) ? '' : $ob['v'], 'label' => $label, 'abbrev' => $abbrev);
+            $label = str_repeat(' ', 2 * $ob['c']) . $ob['l'];
+            $list[$ob['v']] = array('val' => $imaptree->isContainer($ob) ? '' : $ob['v'], 'label' => $label, 'abbrev' => Horde_String::abbreviate($label, 30));
         }
 
         /* Add the INBOX on top of list if not in the filter list. */