X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMagicWord.php;h=143666a907f5efcbd83157ed44486c4674a30eb4;hb=9ea27c314149f1686b40cd63c9d026068efcd8a4;hp=0508f96155e27e15adba0fb9d1043d338fcc2ea2;hpb=45134645f88a4aba3c9b4fb1759078b50631d74a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 0508f96155..143666a907 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -45,6 +45,10 @@ define('MAG_PAGENAMEE', 31); define('MAG_NAMESPACE', 32); define('MAG_TOC', 33); define('MAG_GRAMMAR', 34); +define('MAG_NOTITLECONVERT', 35); +define('MAG_NOCONTENTCONVERT', 36); +define('MAG_CURRENTWEEK', 37); +define('MAG_CURRENTDOW', 38); $wgVariableIDs = array( MAG_CURRENTMONTH, @@ -59,7 +63,9 @@ $wgVariableIDs = array( MAG_SERVER, MAG_PAGENAME, MAG_PAGENAMEE, - MAG_NAMESPACE + MAG_NAMESPACE, + MAG_CURRENTWEEK, + MAG_CURRENTDOW ); /** @@ -116,9 +122,9 @@ class MagicWord { # Initialises this object with an ID function load( $id ) { - global $wgLang; + global $wgContLang; $this->mId = $id; - $wgLang->getMagic( $this ); + $wgContLang->getMagic( $this ); } /** @@ -193,10 +199,10 @@ class MagicWord { $matchcount = preg_match( $this->getVariableStartToEndRegex(), $text, $matches ); if ( $matchcount == 0 ) { return NULL; - } elseif ( count($matches) == 1 ) { + } elseif ( count($matches) == 2 ) { return $matches[0]; } else { - return $matches[1]; + return $matches[2]; } }