User results are printed properly now

This commit is contained in:
Erik Thuning 2022-03-02 10:18:54 +01:00
parent 8502fbf0a1
commit 0f66c8212f

@ -193,12 +193,11 @@ class SearchPage extends Page {
}
$user_table = 'Inga användare hittade.';
if($this->user_hits) {
$users = '';
$users = array();
foreach($this->user_hits as $hit) {
$users .= $this->render_user($hit[0], $hit[1]);
$users[] = $hit[0];
}
$user_table = replace(array('rows' => $users),
$this->fragments['user_table']);
$user_table = $this->build_user_table($users);
}
print(replace(array('terms' => $terms,
@ -207,18 +206,6 @@ class SearchPage extends Page {
'user_results' => $user_table),
$this->fragments['search_form']));
}
private function render_user($user, $matches) {
$link = replace(array('id' => $user->get_id(),
'name' => $user->get_name(),
'page' => 'users'),
$this->fragments['item_link']);
$data = print_r($matches, true);
return $link . '<br/>'
. $data . '<br/>';
}
}
class SearchTerm {