Commit cab7d129 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

More munging in the step 4 replier.

parent 326c9f05
......@@ -48,12 +48,19 @@ switch ($type) {
$userdata = get_user_results($query, $limit, $offset);
$groupdata = get_group_results($query, $limit, $offset);
$resultdata = array();
$i = 0;
foreach ($userdata['data'] as $result) {
$i++;
$resultdata[] = $result;
}
if ($groupdata['data']) {
foreach ($groupdata['data'] as $result) {
if ($i++ >= $limit) {
break;
}
$resultdata[] = $result;
}
}
$data = array(
'count' => $userdata['count'] + $groupdata['count'],
'limit' => $limit,
......@@ -88,12 +95,14 @@ function get_user_results($query, $limit, $offset) {
function get_group_results($query, $limit, $offset) {
$data = search_group($query, $limit, $offset);
if ($data['data']) {
foreach ($data['data'] as &$result) {
unset($result->owner);
unset($result->description);
unset($result->ctime);
unset($result->mtime);
}
}
return $data;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment