From 0924a303337dc6eb76934450aaa59e2c3d350110 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 21 Mar 2008 22:36:34 +0000 Subject: [PATCH] * (bug 9447) Added hooks for search result headings * (bug 13338) DidYouMean extension now displays 'see also' on general search results --- RELEASE-NOTES | 2 ++ docs/hooks.txt | 8 ++++++++ includes/SpecialSearch.php | 3 +++ 3 files changed, 13 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 60c456f5b7..218de1b196 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -52,6 +52,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN ** (bug 1212) Give correct membership counts on the pages of large categories ** Use category table for more efficient display of Special:Categories * (bug 1459) Search for duplicate files by hash: Special:FileDuplicateSearch +* (bug 9447) Added hooks for search result headings + === Bug fixes in 1.13 === diff --git a/docs/hooks.txt b/docs/hooks.txt index 4fe5326aff..136e054409 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1031,6 +1031,14 @@ $list: list (array) of core special pages 'SpecialSearchNogomatch': called when user clicked the "Go" button but the target doesn't exist $title: title object generated from the text entred by the user +'SpecialSearchResults': called before search result display when there are matches +$term: string of search term +$titleMatches: empty or SearchResultSet object +$textMatches: empty or SearchResultSet object + +'SpecialSearchResults': called before search result display when there are no matches +$term: string of search term + 'SpecialVersionExtensionTypes': called when generating the extensions credits, use this to change the tables headers $extTypes: associative array of extensions types diff --git a/includes/SpecialSearch.php b/includes/SpecialSearch.php index 885a81abab..d91445431a 100644 --- a/includes/SpecialSearch.php +++ b/includes/SpecialSearch.php @@ -191,6 +191,9 @@ class SpecialSearch { array( 'search' => $term ) ), ($num < $this->limit) ); $wgOut->addHTML( "

{$prevnext}

\n" ); + wfRunHooks( 'SpecialSearchResults', array( $term, $titleMatches, $textMatches ) ); + } else { + wfRunHooks( 'SpecialSearchNoResults', array( $term ) ); } if( $titleMatches ) { -- 2.20.1