aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorStefan Parviainen <saparvia@caterva.eu>2015-01-07 19:39:50 +0100
committerStefan Parviainen <saparvia@caterva.eu>2015-01-07 19:39:50 +0100
commit34ecbcceea9ae6399f50c6e8718a9f84345136b9 (patch)
tree7feb27f38da9964cb836f7f604cb1dea05fb5aad /mod
parent4e3aadc38a671ebd37d3619ea64f278f5a06f6dc (diff)
downloadvolse-hubzilla-34ecbcceea9ae6399f50c6e8718a9f84345136b9.tar.gz
volse-hubzilla-34ecbcceea9ae6399f50c6e8718a9f84345136b9.tar.bz2
volse-hubzilla-34ecbcceea9ae6399f50c6e8718a9f84345136b9.zip
Make nav search use textcomplete
Diffstat (limited to 'mod')
-rw-r--r--mod/acl.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/mod/acl.php b/mod/acl.php
index e6733351b..d263569ce 100644
--- a/mod/acl.php
+++ b/mod/acl.php
@@ -182,25 +182,25 @@ function acl_init(&$a){
);
}
elseif($type == 'x') {
-
$r = navbar_complete($a);
- $x = array();
- $x['query'] = $search;
- $x['photos'] = array();
- $x['links'] = array();
- $x['suggestions'] = array();
- $x['data'] = array();
+ $contacts = array();
if($r) {
foreach($r as $g) {
- $x['photos'][] = $g['photo'];
- $x['links'][] = $g['url'];
- $x['suggestions'][] = '@' . $g['name'];
- $x['data'][] = $g['name'];
+ $contacts[] = array(
+ "photo" => $g['photo'],
+ "name" => $g['name'],
+ "nick" => $g['address'],
+ );
}
}
- echo json_encode($x);
- killme();
+ $o = array(
+ 'start' => $start,
+ 'count' => $count,
+ 'items' => $contacts,
+ );
+ echo json_encode($o);
+ killme();
}
else
$r = array();
@@ -284,7 +284,7 @@ function navbar_complete(&$a) {
}
$dirmode = intval(get_config('system','directory_mode'));
- $search = ((x($_REQUEST,'query')) ? htmlentities($_REQUEST['query'],ENT_COMPAT,'UTF-8',false) : '');
+ $search = ((x($_REQUEST,'search')) ? htmlentities($_REQUEST['search'],ENT_COMPAT,'UTF-8',false) : '');
if(! $search || mb_strlen($search) < 2)
return array();