]> source.dussan.org Git - nextcloud-server.git/commitdiff
Move code to OC_Contacts_App::scanCategories().
authorThomas Tanghus <thomas@tanghus.net>
Sun, 8 Jul 2012 22:15:37 +0000 (00:15 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Sun, 8 Jul 2012 22:15:37 +0000 (00:15 +0200)
apps/contacts/ajax/categories/rescan.php

index 679f57aa26a271019ce48164609b2b7777cefebd..0d8464a23edf2c04e6f2767919f980558a7b0c7a 100644 (file)
 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)));