* (bug 9447) Added hooks for search result headings
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 21 Mar 2008 22:36:34 +0000 (22:36 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 21 Mar 2008 22:36:34 +0000 (22:36 +0000)
* (bug 13338) DidYouMean extension now displays 'see also' on general search results

RELEASE-NOTES
docs/hooks.txt
includes/SpecialSearch.php

index 60c456f..218de1b 100644 (file)
@@ -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 ===
 
index 4fe5326..136e054 100644 (file)
@@ -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
 
index 885a81a..d914454 100644 (file)
@@ -191,6 +191,9 @@ class SpecialSearch {
                                        array( 'search' => $term ) ),
                                        ($num < $this->limit) );
                        $wgOut->addHTML( "<p>{$prevnext}</p>\n" );
+                       wfRunHooks( 'SpecialSearchResults', array( $term, $titleMatches, $textMatches ) );
+               } else {
+                       wfRunHooks( 'SpecialSearchNoResults', array( $term ) );
                }
 
                if( $titleMatches ) {