aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-10-13 21:31:27 -0400
committercash <cash.costello@gmail.com>2011-10-13 21:31:27 -0400
commitc6a14d6c6a04eeee2c126ea20ec0e9ee23489ef3 (patch)
tree6808e6674d64e7b0997271c347bd605a81e4b843 /engine
parent7e23a3bd6382190084f136ed5aeb6b910ae00eee (diff)
downloadelgg-c6a14d6c6a04eeee2c126ea20ec0e9ee23489ef3.tar.gz
elgg-c6a14d6c6a04eeee2c126ea20ec0e9ee23489ef3.tar.bz2
displaying users that have been selected and added remove capability
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/input.php39
1 files changed, 36 insertions, 3 deletions
diff --git a/engine/lib/input.php b/engine/lib/input.php
index ceda2be3b..f2cefc3e5 100644
--- a/engine/lib/input.php
+++ b/engine/lib/input.php
@@ -288,17 +288,26 @@ function input_livesearch_page_handler($page) {
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
+ $entity = get_entity($entity->guid);
+ if (!$entity) {
+ continue;
+ }
+
if (in_array('groups', $match_on)) {
$value = $entity->guid;
} else {
$value = $entity->username;
}
- $output = elgg_view_list_item(get_entity($entity->guid), array(
+ $output = elgg_view_list_item($entity, array(
'hover' => false,
'class' => 'elgg-autocomplete-item',
));
+ $icon = elgg_view_entity_icon($entity, 'tiny', array(
+ 'hover' => false,
+ ));
+
$result = array(
'type' => 'user',
'name' => $entity->name,
@@ -306,6 +315,8 @@ function input_livesearch_page_handler($page) {
'guid' => $entity->guid,
'label' => $output,
'value' => $value,
+ 'icon' => $icon,
+ 'url' => $entity->getURL(),
);
$results[$entity->name . rand(1, 100)] = $result;
}
@@ -326,11 +337,20 @@ function input_livesearch_page_handler($page) {
";
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
- $output = elgg_view_list_item(get_entity($entity->guid), array(
+ $entity = get_entity($entity->guid);
+ if (!$entity) {
+ continue;
+ }
+
+ $output = elgg_view_list_item($entity, array(
'hover' => false,
'class' => 'elgg-autocomplete-item',
));
+ $icon = elgg_view_entity_icon($entity, 'tiny', array(
+ 'hover' => false,
+ ));
+
$result = array(
'type' => 'group',
'name' => $entity->name,
@@ -338,6 +358,8 @@ function input_livesearch_page_handler($page) {
'guid' => $entity->guid,
'label' => $output,
'value' => $entity->guid,
+ 'icon' => $icon,
+ 'url' => $entity->getURL(),
);
$results[$entity->name . rand(1, 100)] = $result;
@@ -362,11 +384,20 @@ function input_livesearch_page_handler($page) {
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
- $output = elgg_view_list_item(get_entity($entity->guid), array(
+ $entity = get_entity($entity->guid);
+ if (!$entity) {
+ continue;
+ }
+
+ $output = elgg_view_list_item($entity, array(
'hover' => false,
'class' => 'elgg-autocomplete-item',
));
+ $icon = elgg_view_entity_icon($entity, 'tiny', array(
+ 'hover' => false,
+ ));
+
$result = array(
'type' => 'user',
'name' => $entity->name,
@@ -374,6 +405,8 @@ function input_livesearch_page_handler($page) {
'guid' => $entity->guid,
'label' => $output,
'value' => $entity->username,
+ 'icon' => $icon,
+ 'url' => $entity->getURL(),
);
$results[$entity->name . rand(1, 100)] = $result;
}