diff options
author | zottel <github@zottel.net> | 2012-05-07 09:11:45 +0200 |
---|---|---|
committer | zottel <github@zottel.net> | 2012-05-07 09:11:45 +0200 |
commit | a2ea560bf397902ce5608daabf101d0bcf813f13 (patch) | |
tree | 0f4020d6b86c65cc317739b8e562ea50801ec277 /mod/acl.php | |
parent | 3cd428152d8727b838565c462f91accd35204ce1 (diff) | |
parent | c7f3e626d0bb141be86a8af6ffbe40768bc23069 (diff) | |
download | volse-hubzilla-a2ea560bf397902ce5608daabf101d0bcf813f13.tar.gz volse-hubzilla-a2ea560bf397902ce5608daabf101d0bcf813f13.tar.bz2 volse-hubzilla-a2ea560bf397902ce5608daabf101d0bcf813f13.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to 'mod/acl.php')
-rw-r--r-- | mod/acl.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mod/acl.php b/mod/acl.php index 88f150d7a..402d37376 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -13,6 +13,14 @@ function acl_init(&$a){ $type = (x($_REQUEST,'type')?$_REQUEST['type']:""); + // For use with jquery.autocomplete for private mail completion + + if(x($_REQUEST,'query') && strlen($_REQUEST['query'])) { + $type = 'm'; + $search = $_REQUEST['query']; + } + + if ($search!=""){ $sql_extra = "AND `name` LIKE '%%".dbesc($search)."%%'"; $sql_extra2 = "AND (`attag` LIKE '%%".dbesc($search)."%%' OR `name` LIKE '%%".dbesc($search)."%%' OR `nick` LIKE '%%".dbesc($search)."%%')"; @@ -115,6 +123,23 @@ function acl_init(&$a){ else $r = array(); + + if($type == 'm') { + $x = array(); + $x['query'] = $search; + $x['suggestions'] = array(); + $x['data'] = array(); + if(count($r)) { + foreach($r as $g) { + $x['suggestions'][] = sprintf( t('%s [%s]'),$g['name'],$g['url']); + // '<img src="' . $g['micro'] . ' height="16" width="16" alt="' . t('Image/photo') . '" />' . + $x['data'][] = intval($g['id']); + } + } + echo json_encode($x); + killme(); + } + if(count($r)) { foreach($r as $g){ $contacts[] = array( |