Index: trunk/extensions/Arrays/Arrays.php |
— | — | @@ -233,7 +233,6 @@ |
234 | 234 | // print the array upon request |
235 | 235 | switch( self::array_value( $arrayOptions, 'print' ) ) { |
236 | 236 | case 'list': |
237 | | - global $wgLang; |
238 | 237 | // simple list output |
239 | 238 | $out = implode( ', ', $array ); |
240 | 239 | break; |
— | — | @@ -266,7 +265,18 @@ |
267 | 266 | * {{#arrayprint:b|<br/>|@@@|{{f.tag{{f.print.vbar}}prop{{f.print.vbar}}@@@}} }} -- embed template function |
268 | 267 | * {{#arrayprint:b|<br/>|@@@|[[name::@@@]]}} -- make SMW links |
269 | 268 | */ |
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 | + |
271 | 281 | // get array, null if non-existant: |
272 | 282 | $array = self::get( $parser )->getArray( $arrayId ); |
273 | 283 | |
— | — | @@ -311,24 +321,8 @@ |
312 | 322 | $output = trim( $frame->expand( $output ) ); |
313 | 323 | |
314 | 324 | return $output; |
315 | | - } |
| 325 | + } |
316 | 326 | |
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 | | - |
333 | 327 | /** |
334 | 328 | * 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. |
335 | 329 | * usage: |