From 1f44998d14c3393f483fdbfa1d58eb27eb7b2376 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Wed, 16 Oct 2013 16:50:17 +0200 Subject: [PATCH] Pad folder names with spaces to sort parent folders before their childs --- plugins/libkolab/lib/kolab_storage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/libkolab/lib/kolab_storage.php b/plugins/libkolab/lib/kolab_storage.php index 2ebb64d8..d0e20163 100644 --- a/plugins/libkolab/lib/kolab_storage.php +++ b/plugins/libkolab/lib/kolab_storage.php @@ -683,11 +683,12 @@ class kolab_storage */ public static function sort_folders($folders) { + $pad = ' '; $nsnames = array('personal' => array(), 'shared' => array(), 'other' => array()); foreach ($folders as $folder) { $folders[$folder->name] = $folder; $ns = $folder->get_namespace(); - $nsnames[$ns][$folder->name] = strtolower(html_entity_decode(self::object_name($folder->name, $ns), ENT_COMPAT, RCUBE_CHARSET)); // decode » + $nsnames[$ns][$folder->name] = strtolower(html_entity_decode(self::object_name($folder->name, $ns), ENT_COMPAT, RCUBE_CHARSET)) . $pad; // decode » } $names = array();