From: James Earl Douglas Date: Thu, 11 Jun 2015 21:13:20 +0000 (-0700) Subject: Add a SpecialSearchResultsAppend hook X-Git-Tag: 1.31.0-rc.0~11078^2 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=e7551f1621f55ea8d27f82a88fc11bab61d4c9ad;p=lhc%2Fweb%2Fwiklou.git Add a SpecialSearchResultsAppend hook 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 --- diff --git a/RELEASE-NOTES-1.26 b/RELEASE-NOTES-1.26 index c862bf38cf..cc9915a9c8 100644 --- a/RELEASE-NOTES-1.26 +++ b/RELEASE-NOTES-1.26 @@ -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. + diff --git a/docs/hooks.txt b/docs/hooks.txt index fda00f9f83..4546f9e81d 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index ef50fed165..bc1bb3dfaa 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -410,6 +410,9 @@ class SpecialSearch extends SpecialPage { if ( $prevnext ) { $out->addHTML( "

{$prevnext}

\n" ); } + + Hooks::run( 'SpecialSearchResultsAppend', array( $this, $out ) ); + } /**