MediaWiki  master
LanguageConverterSpecific.php
Go to the documentation of this file.
1 <?php
37  public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
38  // check for user namespace
39  if ( is_object( $nt ) ) {
40  $ns = $nt->getNamespace();
41  if ( $ns === NS_USER || $ns === NS_USER_TALK ) {
42  return;
43  }
44  }
45 
46  $oldlink = $link;
47  parent::findVariantLink( $link, $nt, $ignoreOtherCond );
48  if ( $this->getPreferredVariant() == $this->mMainLanguageCode ) {
49  $link = $oldlink;
50  }
51  }
52 }
NS_USER_TALK
const NS_USER_TALK
Definition: Defines.php:72
LanguageConverter\getPreferredVariant
getPreferredVariant()
Get preferred language variant.
Definition: LanguageConverter.php:192
LanguageConverterSpecific
A class that extends LanguageConverter with specific behaviour.
Definition: LanguageConverterSpecific.php:26
LanguageConverterSpecific\findVariantLink
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
A function wrapper:
Definition: LanguageConverterSpecific.php:37
NS_USER
const NS_USER
Definition: Defines.php:71
LanguageConverter
Base class for multi-variant language conversion.
Definition: LanguageConverter.php:35