if ($entities = get_data($query)) {
foreach ($entities as $entity) {
++<<<<<<< HEAD
+ $json = json_encode(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;
++=======
+ $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($entity, array(
+ 'use_hover' => false,
+ 'class' => 'elgg-autocomplete-item',
+ ));
+
+ $icon = elgg_view_entity_icon($entity, 'tiny', array(
+ 'use_hover' => false,
+ ));
+
+ $result = array(
+ 'type' => 'user',
+ 'name' => $entity->name,
+ 'desc' => $entity->username,
+ 'guid' => $entity->guid,
+ 'label' => $output,
+ 'value' => $value,
+ 'icon' => $icon,
+ 'url' => $entity->getURL(),
+ );
+ $results[$entity->name . rand(1, 100)] = $result;
++>>>>>>> 08a962c98e2923724f8013d6eaae89101243752a
}
}
break;
";
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
++<<<<<<< HEAD
+ $json = json_encode(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
+ ));
++=======
+ $entity = get_entity($entity->guid);
+ if (!$entity) {
+ continue;
+ }
+
+ $output = elgg_view_list_item($entity, array(
+ 'use_hover' => false,
+ 'class' => 'elgg-autocomplete-item',
+ ));
+
+ $icon = elgg_view_entity_icon($entity, 'tiny', array(
+ 'use_hover' => false,
+ ));
+
+ $result = array(
+ 'type' => 'group',
+ 'name' => $entity->name,
+ 'desc' => strip_tags($entity->description),
+ 'guid' => $entity->guid,
+ 'label' => $output,
+ 'value' => $entity->guid,
+ 'icon' => $icon,
+ 'url' => $entity->getURL(),
+ );
++>>>>>>> 08a962c98e2923724f8013d6eaae89101243752a
- $results[$entity->name . rand(1, 100)] = $result;
+ $results[$entity->name . rand(1, 100)] = $json;
}
}
break;
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
++<<<<<<< HEAD
+ $json = json_encode(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;
++=======
+ $entity = get_entity($entity->guid);
+ if (!$entity) {
+ continue;
+ }
+
+ $output = elgg_view_list_item($entity, array(
+ 'use_hover' => false,
+ 'class' => 'elgg-autocomplete-item',
+ ));
+
+ $icon = elgg_view_entity_icon($entity, 'tiny', array(
+ 'use_hover' => false,
+ ));
+
+ $result = array(
+ 'type' => 'user',
+ 'name' => $entity->name,
+ 'desc' => $entity->username,
+ 'guid' => $entity->guid,
+ 'label' => $output,
+ 'value' => $entity->username,
+ 'icon' => $icon,
+ 'url' => $entity->getURL(),
+ );
+ $results[$entity->name . rand(1, 100)] = $result;
++>>>>>>> 08a962c98e2923724f8013d6eaae89101243752a
}
}
break;
}
ksort($results);
++<<<<<<< HEAD
+ echo implode($results, "\n");
++=======
+ header("Content-Type: application/json");
+ echo json_encode(array_values($results));
++>>>>>>> 08a962c98e2923724f8013d6eaae89101243752a
exit;
}