diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-07-09 00:15:37 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-07-09 00:15:37 +0200 |
commit | d1cf787197c4a5209881f61c60a9172d7b41a684 (patch) | |
tree | 381fe979b7fd52e359a4b20c27efd2542b0ab9f0 | |
parent | 6116dc6b658873a69ec5adf267df1fb55999bf1a (diff) | |
download | nextcloud-server-d1cf787197c4a5209881f61c60a9172d7b41a684.tar.gz nextcloud-server-d1cf787197c4a5209881f61c60a9172d7b41a684.zip |
Move code to OC_Contacts_App::scanCategories().
-rw-r--r-- | apps/contacts/ajax/categories/rescan.php | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/apps/contacts/ajax/categories/rescan.php b/apps/contacts/ajax/categories/rescan.php index 679f57aa26a..0d8464a23ed 100644 --- a/apps/contacts/ajax/categories/rescan.php +++ b/apps/contacts/ajax/categories/rescan.php @@ -10,22 +10,7 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); -require_once(__DIR__.'/../loghandler.php'); - -$addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser()); -if(count($addressbooks) == 0) { - bailOut(OC_Contacts_App::$l10n->t('No address books found.')); -} -$addressbookids = array(); -foreach($addressbooks as $addressbook) { - $addressbookids[] = $addressbook['id']; -} -$contacts = OC_Contacts_VCard::all($addressbookids); -if(count($contacts) == 0) { - bailOut(OC_Contacts_App::$l10n->t('No contacts found.')); -} - -OC_Contacts_App::scanCategories($contacts); +OC_Contacts_App::scanCategories(); $categories = OC_Contacts_App::getCategories(); OCP\JSON::success(array('data' => array('categories'=>$categories))); |