aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-10-06 22:27:33 -0400
committercash <cash.costello@gmail.com>2011-10-06 22:27:33 -0400
commit28da2f9dcb560687d4904e7629ad38049ed3188a (patch)
treecc91a2192752458884c262cf762753ff4557c086 /engine
parent41256f644b02bf4dcb2bc3798bdf470fa93515da (diff)
downloadelgg-28da2f9dcb560687d4904e7629ad38049ed3188a.tar.gz
elgg-28da2f9dcb560687d4904e7629ad38049ed3188a.tar.bz2
using html extension to jquery.ui autocomplete
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/elgglib.php1
-rw-r--r--engine/lib/input.php24
2 files changed, 16 insertions, 9 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 64bdf9276..5c9479f74 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -2028,6 +2028,7 @@ function elgg_init() {
elgg_register_page_handler('ajax', 'elgg_ajax_page_handler');
elgg_register_js('elgg.autocomplete', 'js/lib/autocomplete.js');
+ elgg_register_js('jquery.ui.autocomplete.html', 'vendors/jquery/jquery.ui.autocomplete.html.js');
elgg_register_js('elgg.userpicker', 'js/lib/userpicker.js');
elgg_register_js('elgg.friendspicker', 'js/lib/friends_picker.js');
elgg_register_js('jquery.easing', 'vendors/jquery/jquery.easing.1.3.packed.js');
diff --git a/engine/lib/input.php b/engine/lib/input.php
index 127113205..e7c3a3d99 100644
--- a/engine/lib/input.php
+++ b/engine/lib/input.php
@@ -288,13 +288,19 @@ function input_livesearch_page_handler($page) {
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
+ if (in_array('groups', $match_on)) {
+ $value = $entity->guid;
+ } else {
+ $value = $entity->username;
+ }
+
$result = array(
'type' => 'user',
'name' => $entity->name,
'desc' => $entity->username,
- 'icon' => '<img class="elgg-livesearch-icon" src="' .
- get_entity($entity->guid)->getIconURL('tiny') . '" />',
- 'guid' => $entity->guid
+ 'guid' => $entity->guid,
+ 'label' => elgg_view_list_item(get_entity($entity->guid), array('hover' => false)),
+ 'value' => $value,
);
$results[$entity->name . rand(1, 100)] = $result;
}
@@ -319,9 +325,9 @@ function input_livesearch_page_handler($page) {
'type' => 'group',
'name' => $entity->name,
'desc' => strip_tags($entity->description),
- 'icon' => '<img class="elgg-livesearch-icon" src="'
- . get_entity($entity->guid)->getIconURL('tiny') . '" />',
- 'guid' => $entity->guid
+ 'guid' => $entity->guid,
+ 'label' => elgg_view_list_item(get_entity($entity->guid)),
+ 'value' => $entity->guid,
);
$results[$entity->name . rand(1, 100)] = $result;
@@ -350,9 +356,9 @@ function input_livesearch_page_handler($page) {
'type' => 'user',
'name' => $entity->name,
'desc' => $entity->username,
- 'icon' => '<img class="elgg-livesearch-icon" src="'
- . get_entity($entity->guid)->getIconURL('tiny') . '" />',
- 'guid' => $entity->guid
+ 'guid' => $entity->guid,
+ 'label' => elgg_view_list_item(get_entity($entity->guid), array('hover' => false)),
+ 'value' => $entity->username,
);
$results[$entity->name . rand(1, 100)] = $result;
}