aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-05-06 19:53:34 -0700
committerfriendica <info@friendica.com>2012-05-06 19:53:34 -0700
commit57920849c4138920b5715931a268dd2a55c76003 (patch)
tree7d408aa9b10e575d8653ca70876ce1c6ae03d8f8 /mod
parent8e46c43ee1307c8c1454e9e8a775343e84e92141 (diff)
downloadvolse-hubzilla-57920849c4138920b5715931a268dd2a55c76003.tar.gz
volse-hubzilla-57920849c4138920b5715931a268dd2a55c76003.tar.bz2
volse-hubzilla-57920849c4138920b5715931a268dd2a55c76003.zip
email recip autocomplete
Diffstat (limited to 'mod')
-rw-r--r--mod/acl.php25
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(