aboutsummaryrefslogtreecommitdiffstats
path: root/mod/acl.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-07 14:39:07 -0800
committerfriendica <info@friendica.com>2015-01-07 14:39:07 -0800
commit087d6744fcd0c77cf3415b4ce6eaf50cdb63b4ef (patch)
treef731ec2ef4b1977306e18c5dc0491a84f42e423f /mod/acl.php
parentce953e2f41c2bf8abdda2584dd84c2bd0175f609 (diff)
parent8771dee9cf90b9c8f76c1856ea7e5107aab5840e (diff)
downloadvolse-hubzilla-087d6744fcd0c77cf3415b4ce6eaf50cdb63b4ef.tar.gz
volse-hubzilla-087d6744fcd0c77cf3415b4ce6eaf50cdb63b4ef.tar.bz2
volse-hubzilla-087d6744fcd0c77cf3415b4ce6eaf50cdb63b4ef.zip
Merge https://github.com/friendica/red into pending_merge
Diffstat (limited to 'mod/acl.php')
-rw-r--r--mod/acl.php48
1 files changed, 14 insertions, 34 deletions
diff --git a/mod/acl.php b/mod/acl.php
index e6733351b..f575db55b 100644
--- a/mod/acl.php
+++ b/mod/acl.php
@@ -182,49 +182,29 @@ 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();
-
- if($type == 'm' || $type == 'a' || $type == 'p') {
- $x = array();
- $x['query'] = $search;
- $x['photos'] = array();
- $x['links'] = array();
- $x['suggestions'] = array();
- $x['data'] = array();
- if(count($r)) {
- foreach($r as $g) {
- $x['photos'][] = $g['micro'];
- $x['links'][] = $g['url'];
- $x['suggestions'][] = $g['name'];
- $x['data'][] = (($type === 'p') ? '@' . str_replace(' ','_',$g['name']) : $g['id']);
- }
- }
- echo json_encode($x);
- killme();
- }
-
if(count($r)) {
foreach($r as $g){
@@ -284,7 +264,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();