Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | $newtype = $wgRequest->getText( 'wpNewType' ); |
31 | 31 | $record = $wgRequest->getText( 'wpRecord' ); |
32 | 32 | $invert = $wgRequest->getText( 'wpInvert' ); |
33 | | - $title = Title::makeTitle( NS_SPECIAL, 'RecordAdmin' ); |
| 33 | + $title = $this->title = Title::makeTitle( NS_SPECIAL, 'RecordAdmin' ); |
34 | 34 | $wpTitle = trim( $wgRequest->getText( 'wpTitle' ) ); |
35 | 35 | |
36 | 36 | if ( $type && $wgRecordAdminUseNamespaces ) { |
— | — | @@ -399,6 +399,7 @@ |
400 | 400 | if ( $v ) $html = preg_replace( "|(/?>)$|", " checked $1", $html ); |
401 | 401 | break; |
402 | 402 | case 'list': |
| 403 | + $html = preg_replace_callback("|\{\{.+\}\}|s", array($this, 'parsePart'), $html); # parse any braces |
403 | 404 | $html = preg_replace( "|(<option[^<>]*) selected|", "$1", $html ); |
404 | 405 | if ( $v ) $html = preg_replace( "|(<option[^>]*)(?=>$v</option>)|s", "$1 selected", $html ); |
405 | 406 | break; |
— | — | @@ -413,6 +414,17 @@ |
414 | 415 | } |
415 | 416 | |
416 | 417 | /** |
| 418 | + * Used to parse any braces in select lists when populating form |
| 419 | + */ |
| 420 | + function parsePart($part) { |
| 421 | + global $wgUser, $wgParser; |
| 422 | + $parser = new Parser; |
| 423 | + $options = ParserOptions::newFromUser( $wgUser ); |
| 424 | + $html = $parser->parse( $part[0], $this->title, $options, true, true )->getText(); |
| 425 | + return ''; |
| 426 | + } |
| 427 | + |
| 428 | + /** |
417 | 429 | * Returns an array of types used by the passed HTML text form |
418 | 430 | * - supported types, text, select, checkbox, textarea |
419 | 431 | */ |