From: Ævar Arnfjörð Bjarmason Date: Mon, 23 May 2005 23:24:00 +0000 (+0000) Subject: * Restored the {{msg:}} magic word, except now it's the wikisyntax X-Git-Tag: 1.5.0alpha2~104 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=fe8625db8091ea4303f1f2aecc8a50190bf4c0bc;p=lhc%2Fweb%2Fwiklou.git * Restored the {{msg:}} magic word, except now it's the wikisyntax representation of wfMsgForContent() rather than a shorthand for {{Template:}} --- diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 4c1f9a9f52..224facbe08 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -24,33 +24,34 @@ define('MAG_CURRENTYEAR', 9); define('MAG_CURRENTTIME', 10); define('MAG_NUMBEROFARTICLES', 11); define('MAG_SUBST', 12); -define('MAG_MSGNW', 13); -define('MAG_NOEDITSECTION', 14); -define('MAG_END', 15); -define('MAG_IMG_THUMBNAIL', 16); -define('MAG_IMG_RIGHT', 17); -define('MAG_IMG_LEFT', 18); -define('MAG_IMG_NONE', 19); -define('MAG_IMG_WIDTH', 20); -define('MAG_IMG_CENTER', 21); -define('MAG_INT', 22); -define('MAG_FORCETOC', 23); -define('MAG_SITENAME', 24); -define('MAG_NS', 25); -define('MAG_LOCALURL', 26); -define('MAG_LOCALURLE', 27); -define('MAG_SERVER', 28); -define('MAG_IMG_FRAMED', 29); -define('MAG_PAGENAME', 30); -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); -define('MAG_REVISIONID', 39); +define('MAG_MSG', 13); +define('MAG_MSGNW', 14); +define('MAG_NOEDITSECTION', 15); +define('MAG_END', 16); +define('MAG_IMG_THUMBNAIL', 17); +define('MAG_IMG_RIGHT', 18); +define('MAG_IMG_LEFT', 19); +define('MAG_IMG_NONE', 20); +define('MAG_IMG_WIDTH', 21); +define('MAG_IMG_CENTER', 22); +define('MAG_INT', 23); +define('MAG_FORCETOC', 24); +define('MAG_SITENAME', 25); +define('MAG_NS', 26); +define('MAG_LOCALURL', 27); +define('MAG_LOCALURLE', 28); +define('MAG_SERVER', 29); +define('MAG_IMG_FRAMED', 30); +define('MAG_PAGENAME', 31); +define('MAG_PAGENAMEE', 32); +define('MAG_NAMESPACE', 33); +define('MAG_TOC', 34); +define('MAG_GRAMMAR', 35); +define('MAG_NOTITLECONVERT', 36); +define('MAG_NOCONTENTCONVERT', 37); +define('MAG_CURRENTWEEK', 38); +define('MAG_CURRENTDOW', 39); +define('MAG_REVISIONID', 40); $wgVariableIDs = array( MAG_CURRENTMONTH, diff --git a/includes/Parser.php b/includes/Parser.php index 99e5c282fe..abd62c63a9 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2038,7 +2038,7 @@ class Parser $nowiki = true; } - # Check if it is an internal message + # int: is the wikitext equivalent of wfMsg() $mwInt =& MagicWord::get( MAG_INT ); if ( $mwInt->matchStartAndRemove( $part1 ) ) { if ( $this->incrementIncludeCount( 'int:'.$part1 ) ) { @@ -2046,6 +2046,15 @@ class Parser $found = true; } } + + # msg: is the wikitext equivalent of wfMsgForContent() + $mwMsg =& MagicWord::get( MAG_MSG ); + if ( $mwMsg->matchStartAndRemove( $part1 ) ) { + if ( $this->incrementIncludeCount( 'msg:'.$part1 ) ) { + $text = $linestart . wfMsgReal( $part1, $args, true, true ); + $found = true; + } + } } # NS