Skip to content
Snippets Groups Projects
Commit 46a771d2 authored by Thomas Tanghus's avatar Thomas Tanghus
Browse files

Sort addressbooks.

parent fb700de4
Branches
No related tags found
No related merge requests found
......@@ -6,6 +6,13 @@
* See the COPYING-README file.
*/
function cmp($a, $b)
{
if ($a['displayname'] == $b['displayname']) {
return 0;
}
return ($a['displayname'] < $b['displayname']) ? -1 : 1;
}
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
......@@ -39,6 +46,8 @@ foreach($contacts_addressbook as $addressbook_id => $contacts) {
}
}
usort($contacts_addressbook, 'cmp');
$tmpl = new OCP\Template("contacts", "part.contacts");
$tmpl->assign('books', $contacts_addressbook, false);
$page = $tmpl->fetchPage();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment