* TODO: Implement message, global.
*/
$wgAllowPrefChange = array();
+
+/**
+ * If an exact match is not found, try to find a match in a different namespace
+ * before performing a search.
+ *
+ * Integer: Id of namespace to attempt match in.
+ */
+$wgSecondaryGoNamespace = null;
* @return Title
*/
public static function getNearMatch( $searchterm ) {
- global $wgContLang;
+ global $wgContLang, $wgSecondaryGoNamespace;
$allSearchTerms = array($searchterm);
return $title;
}
+ # If a match is not found in the main namespace look in secondary go namespace.
+ if( $wgSecondaryGoNamespace && $title->getNamespace() == NS_MAIN ) {
+ $title = Title::newFromText( $term, $wgSecondaryGoNamespace );
+ if( $title && $title->exists() ) return $title;
+ }
+
# Now try all lower case (i.e. first letter capitalized)
#
$title = Title::newFromText( $wgContLang->lc( $term ) );