Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -34,6 +34,9 @@ |
35 | 35 | /// Search engine |
36 | 36 | protected $searchEngine; |
37 | 37 | |
| 38 | + /// For links |
| 39 | + protected $extraParams = array(); |
| 40 | + |
38 | 41 | const NAMESPACES_CURRENT = 'sense'; |
39 | 42 | |
40 | 43 | public function __construct() { |
— | — | @@ -436,7 +439,7 @@ |
437 | 440 | $opt['ns' . $n] = 1; |
438 | 441 | } |
439 | 442 | } |
440 | | - return $opt; |
| 443 | + return $opt + $this->extraParams; |
441 | 444 | } |
442 | 445 | |
443 | 446 | /** |
— | — | @@ -1082,4 +1085,15 @@ |
1083 | 1086 | } |
1084 | 1087 | return $this->searchEngine; |
1085 | 1088 | } |
| 1089 | + |
| 1090 | + /** |
| 1091 | + * Users of hook SpecialSearchSetupEngine can use this to |
| 1092 | + * add more params to links to not lose selection when |
| 1093 | + * user navigates search results. |
| 1094 | + * @since 1.18 |
| 1095 | + */ |
| 1096 | + public function setExtraParam( $key, $value ) { |
| 1097 | + $this->extraParams[$key] = $value; |
| 1098 | + } |
| 1099 | + |
1086 | 1100 | } |
Index: trunk/extensions/Translate/TranslateEditAddons.php |
— | — | @@ -554,6 +554,7 @@ |
555 | 555 | $selected = $context->getRequest()->getVal( 'languagefilter' ); |
556 | 556 | if ( $selected !== '-' && $selected ) { |
557 | 557 | $engine->setFeatureData( 'title-suffix-filter', "/$selected" ); |
| 558 | + $search->setExtraParam( 'languagefilter', $selected ); |
558 | 559 | } |
559 | 560 | return true; |
560 | 561 | } |