diff options
author | sembrestels <sembrestels@riseup.net> | 2011-09-14 00:15:07 +0200 |
---|---|---|
committer | sembrestels <sembrestels@riseup.net> | 2011-09-14 00:15:07 +0200 |
commit | 3939a817def8d0a3d047456c4ad3817d5ee0a1d5 (patch) | |
tree | a28582604fda1e92645a7ead35600904ca36a79a /engine/lib/input.php | |
parent | 50aa0ce357fd307ac2623e96f22d7c0f973b22ff (diff) | |
parent | b4f38ff041fcfe5c1a685f55fd8a801648b0f6b5 (diff) | |
download | elgg-3939a817def8d0a3d047456c4ad3817d5ee0a1d5.tar.gz elgg-3939a817def8d0a3d047456c4ad3817d5ee0a1d5.tar.bz2 |
Merge branch 'livesearch_patch' of https://github.com/blacktooth/Elgg
Diffstat (limited to 'engine/lib/input.php')
-rw-r--r-- | engine/lib/input.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/engine/lib/input.php b/engine/lib/input.php index 56ec214dc..8ba3ac180 100644 --- a/engine/lib/input.php +++ b/engine/lib/input.php @@ -294,15 +294,15 @@ function input_livesearch_page_handler($page) { if ($entities = get_data($query)) { foreach ($entities as $entity) { - $json = json_encode(array( + $result = array( 'type' => 'user', 'name' => $entity->name, 'desc' => $entity->username, 'icon' => '<img class="livesearch_icon" src="' . get_entity($entity->guid)->getIconURL('tiny') . '" />', 'guid' => $entity->guid - )); - $results[$entity->name . rand(1, 100)] = $json; + ); + $results[$entity->name . rand(1, 100)] = $result; } } break; @@ -321,16 +321,16 @@ function input_livesearch_page_handler($page) { "; if ($entities = get_data($query)) { foreach ($entities as $entity) { - $json = json_encode(array( + $result = array( 'type' => 'group', 'name' => $entity->name, 'desc' => strip_tags($entity->description), 'icon' => '<img class="livesearch_icon" src="' . get_entity($entity->guid)->getIcon('tiny') . '" />', 'guid' => $entity->guid - )); + ); - $results[$entity->name . rand(1, 100)] = $json; + $results[$entity->name . rand(1, 100)] = $result; } } break; @@ -353,15 +353,15 @@ function input_livesearch_page_handler($page) { if ($entities = get_data($query)) { foreach ($entities as $entity) { - $json = json_encode(array( + $result = array( 'type' => 'user', 'name' => $entity->name, 'desc' => $entity->username, 'icon' => '<img class="livesearch_icon" src="' . get_entity($entity->guid)->getIcon('tiny') . '" />', 'guid' => $entity->guid - )); - $results[$entity->name . rand(1, 100)] = $json; + ); + $results[$entity->name . rand(1, 100)] = $result; } } break; @@ -376,7 +376,7 @@ function input_livesearch_page_handler($page) { } ksort($results); - echo implode($results, "\n"); + echo json_encode(array_values($results)); exit; } |