Skip to content
Snippets Groups Projects
Unverified Commit f0861d1f authored by Michael Große's avatar Michael Große
Browse files

refactor(search): clearer data flow

parent b12bcb77
No related branches found
No related tags found
No related merge requests found
......@@ -580,26 +580,20 @@ class Search extends Ui
$resultHeader[] = $restrictQueryToNSLink;
}
$snippet = '';
$hits = '';
$resultBody = [];
$mtime = filemtime(wikiFN($id));
$lastMod = '<span class="lastmod">' . $lang['lastmod'] . '</span> ';
$lastMod .= '<time datetime="' . date_iso8601($mtime) . '" title="'.dformat($mtime).'">' . dformat($mtime, '%f') . '</time>';
$resultBody['meta'] = $lastMod;
if ($cnt !== 0) {
$hits = '<span class="hits">' . $cnt . ' ' . $lang['hits'] . '</span>, ';
$resultBody['meta'] = $hits . $resultBody['meta'];
if ($num < FT_SNIPPET_NUMBER) { // create snippets for the first number of matches only
$snippet = ft_snippet($id, $highlight);
$resultBody['snippet'] = ft_snippet($id, $highlight);
}
$num++;
}
$resultBody['meta'] = $hits . $lastMod;
if ($snippet) {
$resultBody['snippet'] = $snippet;
}
$eventData = [
'resultHeader' => $resultHeader,
'resultBody' => $resultBody,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment