]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cleanup code.
authorThomas Tanghus <thomas@tanghus.net>
Thu, 14 Jun 2012 20:44:54 +0000 (22:44 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Thu, 14 Jun 2012 21:05:31 +0000 (23:05 +0200)
apps/contacts/lib/search.php

index 144138a7c2c4e44f732f6c3b6f3254cdd50b815b..19330fa9be1168c33c0171b92c23fc411ecf7a6e 100644 (file)
@@ -2,17 +2,10 @@
 class OC_Search_Provider_Contacts extends OC_Search_Provider{
        function search($query){
                $addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser(), 1);
-//             if(count($calendars)==0 || !OCP\App::isEnabled('contacts')){
-//                     //return false;
-//             }
-               // NOTE: Does the following do anything
-               $results=array();
-               $searchquery=array();
-               if(substr_count($query, ' ') > 0){
-                       $searchquery = explode(' ', $query);
-               }else{
-                       $searchquery[] = $query;
+               if(count($addressbooks)==0 || !OCP\App::isEnabled('contacts')){
+                       return array();
                }
+               $results=array();
                $l = new OC_l10n('contacts');
                foreach($addressbooks as $addressbook){
                        $vcards = OC_Contacts_VCard::all($addressbook['id']);