diff --git a/inc/Ui/Search.php b/inc/Ui/Search.php index cbc090b529..6c1bb18d0e 100644 --- a/inc/Ui/Search.php +++ b/inc/Ui/Search.php @@ -280,19 +280,13 @@ protected function getPageLookupHTML($data) $html .= '

' . $lang['quickhits'] . ':

'; $html .= ' '; //clear float (see http://www.complexspiral.com/publications/containing-floats/) @@ -322,18 +316,27 @@ protected function getFulltextResultsHTML($data, $highlight) $html .= '
'; $num = 1; foreach ($data as $id => $cnt) { - $html .= '
'; - $html .= html_wikilink(':' . $id, useHeading('navigation') ? null : $id, $highlight); - if ($cnt !== 0) { - $html .= ': ' . $cnt . ' ' . $lang['hits'] . ''; - } - $html .= '
'; + $resultLink = html_wikilink(':' . $id, null, $highlight); + $hits = ''; + $snippet = ''; if ($cnt !== 0) { + $hits = $cnt . ' ' . $lang['hits']; if ($num < FT_SNIPPET_NUMBER) { // create snippets for the first number of matches only - $html .= '
' . ft_snippet($id, $highlight) . '
'; + $snippet = '
' . ft_snippet($id, $highlight) . '
'; } $num++; } + + $eventData = [ + 'resultHeader' => [$resultLink, $hits], + 'resultBody' => [$snippet], + 'page' => $id, + ]; + trigger_event('SEARCH_RESULT_FULLPAGE', $eventData); + $html .= '
'; + $html .= '
' . implode(' ', $eventData['resultHeader']) . '
'; + $html .= implode('', $eventData['resultBody']); + $html .= '
'; } $html .= '
';