Index: branches/wikidata/includes/SearchEngine.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | * @private |
51 | 51 | */ |
52 | 52 | function getNearMatch( $searchterm ) { |
53 | | - global $wgContLang; |
| 53 | + global $wgContLang,$wgDefaultGoPrefix; |
54 | 54 | |
55 | 55 | $allSearchTerms = array($searchterm); |
56 | 56 | |
— | — | @@ -68,6 +68,10 @@ |
69 | 69 | return $title; |
70 | 70 | } |
71 | 71 | |
| 72 | + if(!empty($wgDefaultGoPrefix) && $title->getNamespace == NS_MAIN ) { |
| 73 | + $term=$wgDefaultGoPrefix.$term; |
| 74 | + } |
| 75 | + |
72 | 76 | # Now try all lower case (i.e. first letter capitalized) |
73 | 77 | # |
74 | 78 | $title = Title::newFromText( $wgContLang->lc( $term ) ); |
Index: branches/wikidata/includes/DefaultSettings.php |
— | — | @@ -2476,5 +2476,11 @@ |
2477 | 2477 | * |
2478 | 2478 | */ |
2479 | 2479 | $wgCustomHandlerPath = array('*'=>"{$IP}/extensions/"); |
| 2480 | + |
| 2481 | +/* |
| 2482 | + * Prefix to be added before "Go" searches, e.g. point to a different |
| 2483 | + * namespace. |
| 2484 | + */ |
| 2485 | +$wgDefaultGoPrefix=''; |
2480 | 2486 | |
2481 | 2487 | ?> |