Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php |
— | — | @@ -516,9 +516,6 @@ |
517 | 517 | # If values are wikitext, convert to hash |
518 | 518 | if ( !is_array( $values ) ) $values = $this->valuesFromText( $values ); |
519 | 519 | |
520 | | - # Expand any double-brace expressions in the form content (even in its html) |
521 | | - #$this->form = preg_replace_callback( "|\{\{.+?\}\}|s", array( $this, 'parsePart' ), $this->form ); |
522 | | - |
523 | 520 | # Add the values into the form's HTML depending on their type |
524 | 521 | foreach( $this->types as $k => $type ) { |
525 | 522 | |
— | — | @@ -559,6 +556,23 @@ |
560 | 557 | # Replace the element in the form with the modified html |
561 | 558 | $this->form = substr_replace( $this->form, $html, $pos, $len ); |
562 | 559 | } |
| 560 | + |
| 561 | + # Parse any brace structures |
| 562 | + global $wgUser, $wgParser; |
| 563 | + $options = ParserOptions::newFromUser( $wgUser ); |
| 564 | + $max = 25; |
| 565 | + do { |
| 566 | + $braces = false; |
| 567 | + foreach ( $this->examineBraces( $this->form ) as $brace ) { |
| 568 | + if ( $brace['DEPTH'] == 2 ) $braces = $brace; |
| 569 | + } |
| 570 | + if ( $braces ) { |
| 571 | + $part = substr( $this->form, $braces['OFFSET'], $braces['LENGTH'] ); |
| 572 | + $html = $wgParser->parse( $part, $this->title, $options, true, true )->getText(); |
| 573 | + $this->form = substr_replace( $this->form, $html, $braces['OFFSET'], $braces['LENGTH'] ); |
| 574 | + } |
| 575 | + } while ( --$max > 0 && $braces ); |
| 576 | + |
563 | 577 | } |
564 | 578 | |
565 | 579 | /** |
Index: trunk/extensions/RecordAdmin/RecordAdmin.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * @licence GNU General Public Licence 2.0 or later |
13 | 13 | */ |
14 | 14 | |
15 | | -define( 'RECORDADMIN_VERSION', '0.8.9, 2009-10-17' ); |
| 15 | +define( 'RECORDADMIN_VERSION', '0.8.10, 2009-10-19' ); |
16 | 16 | |
17 | 17 | $wgRecordAdminUseNamespaces = false; # Whether record articles should be in a namespace of the same name as their type |
18 | 18 | $wgRecordAdminCategory = 'Records'; # Category containing record types |