Pad folder names with spaces to sort parent folders before their childs
This commit is contained in:
parent
d230fa51f8
commit
1f44998d14
1 changed files with 2 additions and 1 deletions
|
@ -683,11 +683,12 @@ class kolab_storage
|
||||||
*/
|
*/
|
||||||
public static function sort_folders($folders)
|
public static function sort_folders($folders)
|
||||||
{
|
{
|
||||||
|
$pad = ' ';
|
||||||
$nsnames = array('personal' => array(), 'shared' => array(), 'other' => array());
|
$nsnames = array('personal' => array(), 'shared' => array(), 'other' => array());
|
||||||
foreach ($folders as $folder) {
|
foreach ($folders as $folder) {
|
||||||
$folders[$folder->name] = $folder;
|
$folders[$folder->name] = $folder;
|
||||||
$ns = $folder->get_namespace();
|
$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();
|
$names = array();
|
||||||
|
|
Loading…
Add table
Reference in a new issue