Added groups list sorting

This commit is contained in:
Aleksander Machniak (Kolab Systems) 2011-07-05 20:11:19 +02:00
parent 631f19ca5e
commit f5edc20089

View file

@ -239,9 +239,13 @@ class rcube_kolab_contacts extends rcube_addressbook
$groups = array();
foreach ((array)$this->distlists as $group) {
if (!$search || strstr(strtolower($group['last-name']), strtolower($search)))
$groups[] = array('ID' => $group['ID'], 'name' => $group['last-name']);
$groups[$group['last-name']] = array('ID' => $group['ID'], 'name' => $group['last-name']);
}
return $groups;
// sort groups
ksort($groups, SORT_LOCALE_STRING);
return array_values($groups);
}