Blame view

sources/apps/calendar/ajax/search-location.php 344 Bytes
6d9380f96   Cédric Dupont   Update sources OC...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  <?php
  
  \OCP\User::checkLoggedIn();
  
  $result = \OCP\Contacts::search($_REQUEST['term'], array('FN', 'ADR'));
  
  $contacts = array();
  
  foreach ($result as $r) {
  	if (!isset($r['ADR'])) {
  		continue;
  	}
  
  	$tmp = $r['ADR'][0];
  	$address = trim(implode(" ", $tmp));
    
  	$contacts[] = array('label' => $address);
  }
  
  \OCP\JSON::EncodedPrint($contacts);