aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/input.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-07-29 11:42:02 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-07-29 11:42:02 -0300
commitbb3c9a26bb75c76c5934d327548bf08606467b9f (patch)
tree26760aa866799fc70683ef6845bf54fb17bdc955 /engine/lib/input.php
parent2feedf39f6484879333a7b77fdc3c184150db8c7 (diff)
parent398572fd96c72b363fd5a252fb9cbe1cecab1e04 (diff)
downloadelgg-bb3c9a26bb75c76c5934d327548bf08606467b9f.tar.gz
elgg-bb3c9a26bb75c76c5934d327548bf08606467b9f.tar.bz2
Merge branch 'floxglove-3' into saravea
Conflicts: .gitmodules
Diffstat (limited to 'engine/lib/input.php')
-rw-r--r--engine/lib/input.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/engine/lib/input.php b/engine/lib/input.php
index 6d1646e1a..2d9bae4dd 100644
--- a/engine/lib/input.php
+++ b/engine/lib/input.php
@@ -226,6 +226,8 @@ function elgg_clear_sticky_value($form_name, $variable) {
/**
* Page handler for autocomplete endpoint.
*
+ * @todo split this into functions/objects, this is way too big
+ *
* /livesearch?q=<query>
*
* Other options include:
@@ -233,6 +235,7 @@ function elgg_clear_sticky_value($form_name, $variable) {
* match_owner int 0/1
* limit int default is 10
*
+ * @param array $page
* @return string JSON string is returned and then exit
* @access private
*/
@@ -265,10 +268,8 @@ function input_livesearch_page_handler($page) {
}
if (get_input('match_owner', false)) {
- $owner_guid = $user->getGUID();
$owner_where = 'AND e.owner_guid = ' . $user->getGUID();
} else {
- $owner_guid = null;
$owner_where = '';
}
@@ -289,7 +290,9 @@ function input_livesearch_page_handler($page) {
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
+ // @todo use elgg_get_entities (don't query in a loop!)
$entity = get_entity($entity->guid);
+ /* @var ElggUser $entity */
if (!$entity) {
continue;
}
@@ -338,7 +341,9 @@ function input_livesearch_page_handler($page) {
";
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
+ // @todo use elgg_get_entities (don't query in a loop!)
$entity = get_entity($entity->guid);
+ /* @var ElggGroup $entity */
if (!$entity) {
continue;
}
@@ -385,7 +390,9 @@ function input_livesearch_page_handler($page) {
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
+ // @todo use elgg_get_entities (don't query in a loop!)
$entity = get_entity($entity->guid);
+ /* @var ElggUser $entity */
if (!$entity) {
continue;
}