r104279 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104278‎ | r104279 | r104280 >
Date:16:55, 26 November 2011
Author:danwe
Status:deferred
Tags:
Comment:
removed obsolete function ExtArrays::pf_arrayprint(), pfObj_arrayprint() adopted the functionality now since MW < 1.12 isn't supported anyway.
Modified paths:
  • /trunk/extensions/Arrays/Arrays.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Arrays/Arrays.php
@@ -233,7 +233,6 @@
234234 // print the array upon request
235235 switch( self::array_value( $arrayOptions, 'print' ) ) {
236236 case 'list':
237 - global $wgLang;
238237 // simple list output
239238 $out = implode( ', ', $array );
240239 break;
@@ -266,7 +265,18 @@
267266 * {{#arrayprint:b|<br/>|@@@|{{f.tag{{f.print.vbar}}prop{{f.print.vbar}}@@@}} }} -- embed template function
268267 * {{#arrayprint:b|<br/>|@@@|[[name::@@@]]}} -- make SMW links
269268 */
270 - static function pf_arrayprint( Parser &$parser, $arrayId , $delimiter = ', ', $search = '@@@@', $subject = '@@@@', $frame = null ) {
 269+ static function pfObj_arrayprint( Parser &$parser, $frame, $args ) {
 270+ // Get Parameters
 271+ $arrayId = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : '';
 272+ $delimiter = isset( $args[1] ) ? trim( $frame->expand( $args[1] ) ) : ', ';
 273+ /*
 274+ * PPFrame::NO_ARGS and PPFrame::NO_TEMPLATES for expansion make a lot of sense here since the patterns getting replaced
 275+ * in $subject before $subject is being parsed. So any template or argument influence in the patterns wouldn't make any
 276+ * sense in any sane scenario.
 277+ */
 278+ $search = isset( $args[2] ) ? trim( $frame->expand( $args[2], PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES ) ) : '@@@@';
 279+ $subject = isset( $args[3] ) ? trim( $frame->expand( $args[3], PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES ) ) : '@@@@';
 280+
271281 // get array, null if non-existant:
272282 $array = self::get( $parser )->getArray( $arrayId );
273283
@@ -311,24 +321,8 @@
312322 $output = trim( $frame->expand( $output ) );
313323
314324 return $output;
315 - }
 325+ }
316326
317 - static function pfObj_arrayprint( Parser &$parser, $frame, $args ) {
318 - // Get Parameters
319 - $arrayId = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : '';
320 - $delimiter = isset( $args[1] ) ? trim( $frame->expand( $args[1] ) ) : ', ';
321 - /*
322 - * PPFrame::NO_ARGS and PPFrame::NO_TEMPLATES for expansion make a lot of sense here since the patterns getting replaced
323 - * in $subject before $subject is being parsed. So any template or argument influence in the patterns wouldn't make any
324 - * sense in any sane scenario.
325 - */
326 - $search = isset( $args[2] ) ? trim( $frame->expand( $args[2], PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES ) ) : '@@@@';
327 - $subject = isset( $args[3] ) ? trim( $frame->expand( $args[3], PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES ) ) : '@@@@';
328 -
329 - return self::pf_arrayprint( $parser, $arrayId, $delimiter, $search, $subject, $frame );
330 - }
331 -
332 -
333327 /**
334328 * print the value of an array (identified by arrayid) by the index, invalid index results in the default value being printed. note the index is 0-based.
335329 * usage:

Status & tagging log