示例#1
0
 function findVariantLink(&$link, &$nt)
 {
     $oldlink = $link;
     parent::findVariantLink($link, $nt);
     if ($this->getPreferredVariant() == $this->mMainLanguageCode) {
         $link = $oldlink;
     }
 }
示例#2
0
 /**
  * A function wrapper:
  *   - if there is no selected variant, leave the link
  *     names as they were
  *   - do not try to find variants for usernames
  *
  * @param $link string
  * @param $nt Title
  * @param $ignoreOtherCond bool
  */
 function findVariantLink(&$link, &$nt, $ignoreOtherCond = false)
 {
     // check for user namespace
     if (is_object($nt)) {
         $ns = $nt->getNamespace();
         if ($ns == NS_USER || $ns == NS_USER_TALK) {
             return;
         }
     }
     $oldlink = $link;
     parent::findVariantLink($link, $nt, $ignoreOtherCond);
     if ($this->getPreferredVariant() == $this->mMainLanguageCode) {
         $link = $oldlink;
     }
 }
示例#3
0
 /**
  * If a language supports multiple variants, it is
  * possible that non-existing link in one variant
  * actually exists in another variant. this function
  * tries to find it. See e.g. LanguageZh.php
  * The input parameters may be modified upon return
  *
  * @param string &$link The name of the link
  * @param Title &$nt The title object of the link
  * @param bool $ignoreOtherCond To disable other conditions when
  *   we need to transclude a template or update a category's link
  */
 public function findVariantLink(&$link, &$nt, $ignoreOtherCond = false)
 {
     $this->mConverter->findVariantLink($link, $nt, $ignoreOtherCond);
 }