r103838 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103837‎ | r103838 | r103839 >
Date:21:30, 21 November 2011
Author:danwe
Status:deferred
Tags:
Comment:
Internationalization description corrected and clarified, pfObj prefix for parser function
Modified paths:
  • /trunk/extensions/ParserFun/ParserFun.i18n.magic.php (modified) (history)
  • /trunk/extensions/ParserFun/ParserFun.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFun/ParserFun.i18n.magic.php
@@ -17,7 +17,7 @@
1818 * @author Daniel Werner
1919 */
2020 $magicWords['en'] = array(
21 - 'parse' => array( false, 'parse' ),
 21+ 'parse' => array( 0, 'parse' ),
2222 ExtParserFun::MAG_THIS => array( 1, 'THIS' ),
2323 );
2424
@@ -25,13 +25,13 @@
2626 * @author Daniel Werner
2727 */
2828 $messages['qqq'] = array(
29 - 'parse' => array( 1, 'Keyword to put in front of a variable like "{{THIS:PAGENAME}}". This will output the pagename of the page where it is defined on instead of the page actually being parsed. "THIS" refers to that page.' ),
 29+ 'parse' => array( 0, 'Do not translate this! This is the magic word for the "#parse" function' ),
 30+ ExtParserFun::MAG_THIS => array( 1, 'Keyword to put in front of a variable like "{{THIS:PAGENAME}}". This will output the pagename of the page where it is defined on instead of the page actually being parsed. "THIS" refers to that page.' ),
3031 );
3132
3233 /** German (Deutsch)
3334 * @author Daniel Werner
3435 */
3536 $magicWords['de'] = array(
36 - 'parse' => array( false, 'parse' ),
3737 ExtParserFun::MAG_THIS => array( 1, 'DIESER', 'DIESE', 'DIESES' ),
3838 );
Index: trunk/extensions/ParserFun/ParserFun.php
@@ -89,7 +89,7 @@
9090 global $egParserFunDisabledFunctions;
9191 if( ! in_array( self::MAG_THIS, $egParserFunDisabledFunctions ) ) {
9292 // only register function if not disabled by configuration
93 - $parser->setFunctionHook( self::MAG_THIS, array( __CLASS__, 'this_' ), SFH_NO_HASH | SFH_OBJECT_ARGS );
 93+ $parser->setFunctionHook( self::MAG_THIS, array( __CLASS__, 'pfObj_this' ), SFH_NO_HASH | SFH_OBJECT_ARGS );
9494 }
9595 return true;
9696 }
@@ -113,7 +113,7 @@
114114 /**
115115 * Magic word 'THIS:' to return certain information about the page the word actually is defined on
116116 */
117 - static function this_( Parser &$parser, PPFrame $frame = null, $args = null ) {
 117+ static function pfObj_this( Parser &$parser, PPFrame $frame = null, $args = null ) {
118118 // if MW version is too old or something is wrong:
119119 if( $frame === null || $frame->title === null ) {
120120 return '';
@@ -246,7 +246,7 @@
247247 switch( $magicWordId ) {
248248 /** THIS **/
249249 case self::MAG_THIS:
250 - $ret = self::this_( $parser, $frame, null );
 250+ $ret = self::pfObj_this( $parser, $frame, null );
251251 break;
252252 }
253253 return true;

Status & tagging log