From: Niklas Laxström Date: Fri, 22 Apr 2011 20:25:21 +0000 (+0000) Subject: Implemented param tracking for hook users, feels a bit hackish X-Git-Tag: 1.31.0-rc.0~30624 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=c86a22d9946fb86c4955d5e4ce69d8d51252e9bd;p=lhc%2Fweb%2Fwiklou.git Implemented param tracking for hook users, feels a bit hackish --- diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 7fe8e0e4b5..2deb67c2dd 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -34,6 +34,9 @@ class SpecialSearch extends SpecialPage { /// Search engine protected $searchEngine; + /// For links + protected $extraParams = array(); + const NAMESPACES_CURRENT = 'sense'; public function __construct() { @@ -436,7 +439,7 @@ class SpecialSearch extends SpecialPage { $opt['ns' . $n] = 1; } } - return $opt; + return $opt + $this->extraParams; } /** @@ -1082,4 +1085,15 @@ class SpecialSearch extends SpecialPage { } return $this->searchEngine; } + + /** + * Users of hook SpecialSearchSetupEngine can use this to + * add more params to links to not lose selection when + * user navigates search results. + * @since 1.18 + */ + public function setExtraParam( $key, $value ) { + $this->extraParams[$key] = $value; + } + }