Add a SpecialSearchResultsAppend hook
authorJames Earl Douglas <james@earldouglas.com>
Thu, 11 Jun 2015 21:13:20 +0000 (14:13 -0700)
committerErik Bernhardson <ebernhardson@wikimedia.org>
Mon, 15 Jun 2015 19:59:36 +0000 (12:59 -0700)
This allows additional HTML to be included below search results.  This
will be used to optionally include a feedback link fter search results.

Bug: T101783
Change-Id: I5c4bab12ed0b022c84aa6b50ab72635e9dd0bd0c

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

index c862bf3..cc9915a 100644 (file)
@@ -18,6 +18,10 @@ production.
 * ':' (colon) is now invalid in usernames for new accounts. Existing accounts
   are not affected.
 * Added a new hook, 'LogException', to log exceptions in nonstandard ways.
+* Revive the 'SpecialSearchResultsAppend' hook which occurs after the list of
+  search results are rendered. The initial use case is to append a "give us
+  feedback" link beneath the search results.
+
 
 ==== External libraries ====
 * Update es5-shim from v4.0.0 to v4.1.5.
@@ -144,3 +148,4 @@ going to run a public MediaWiki, so you can be notified of security fixes.
 == IRC help ==
 
 There's usually someone online in #mediawiki on irc.freenode.net.
+
index fda00f9..4546f9e 100644 (file)
@@ -2852,6 +2852,11 @@ $specialSearch: SpecialSearch object ($this)
 $output: $wgOut
 $term: Search term specified by the user
 
+'SpecialSearchResultsAppend': Called immediately before returning HTML
+on the search results page.  Useful for including a feedback link.
+$specialSearch: SpecialSearch object ($this)
+$output: $wgOut
+
 'SpecialSearchSetupEngine': Allows passing custom data to search engine.
 $search: SpecialSearch special page object
 $profile: String: current search profile
index ef50fed..bc1bb3d 100644 (file)
@@ -410,6 +410,9 @@ class SpecialSearch extends SpecialPage {
                if ( $prevnext ) {
                        $out->addHTML( "<p class='mw-search-pager-bottom'>{$prevnext}</p>\n" );
                }
+
+               Hooks::run( 'SpecialSearchResultsAppend', array( $this, $out ) );
+
        }
 
        /**