1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-31 20:52:17 +01:00
2013-01-29 20:17:55 +01:00

17 lines
526 B
PHP

<?php
namespace OCA\Contacts;
class SearchProvider extends \OC_Search_Provider{
function search($query) {
$results = \OCP\Contacts::search($query, array('N', 'FN', 'EMAIL', 'NICKNAME', 'ORG'));
$l = new \OC_l10n('contacts');
foreach($results as $result) {
$vcard = VCard::find($result['id']);
$link = \OCP\Util::linkTo('contacts', 'index.php').'#' . $vcard['id'];
$results[]=new \OC_Search_Result($vcard['fullname'], '', $link, (string)$l->t('Contact'));//$name,$text,$link,$type
}
return $results;
}
}