Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -347,11 +347,9 @@ |
348 | 348 | // element, so that the wiki parser won't touch it - the parser will |
349 | 349 | // remove the '<nowiki>' tags, leaving us with what we need. |
350 | 350 | $form_def = "__NOEDITSECTION__" . strtr( $form_def, array( '{{{' => '<nowiki>{{{', '}}}' => '}}}</nowiki>' ) ); |
351 | | - if ( empty( $wgParser->mOptions ) ) { |
352 | | - if ( !StubObject::isRealObject($wgParser) ) $wgParser -> _unstub(); |
353 | | - $wgParser->startExternalParse( $this->mPageTitle, ParserOptions::newFromUser($wgUser), Parser::OT_HTML, true ); |
354 | | - } |
355 | 351 | |
| 352 | + $parser = new Parser(); |
| 353 | + |
356 | 354 | // Get the form definition from the cache, if we're using caching and it's |
357 | 355 | // there. |
358 | 356 | // $got_form_def_from_cache = false; |
— | — | @@ -366,15 +364,9 @@ |
367 | 365 | // } |
368 | 366 | // Otherwise, parse it. |
369 | 367 | // if ( ! $got_form_def_from_cache ) { |
370 | | - $form_def = $wgParser->recursiveTagParse( $form_def ); |
371 | | - $form_def = $wgParser->mStripState->unstripBoth( $form_def ); |
372 | | - $form_def = $wgParser->doBlockLevels( $form_def, true ); |
373 | | - wfRunHooks( 'ParserAfterTidy', array( &$wgParser, &$form_def ) ); |
374 | | -// } else { |
375 | | -// $form_def = $wgParser->parse( $form_def, $this->mPageTitle, $wgParser->mOptions )->getText(); |
376 | | -// } |
| 368 | + $form_def = $parser->parse($form_def, $this->mPageTitle, ParserOptions::newFromUser($wgUser))->getText(); |
377 | 369 | // } |
378 | | - |
| 370 | + |
379 | 371 | // Turn form definition file into an array of sections, one for each |
380 | 372 | // template definition (plus the first section) |
381 | 373 | $form_def_sections = array(); |
— | — | @@ -683,7 +675,7 @@ |
684 | 676 | if ( $sub_components[0] == 'input type' ) { |
685 | 677 | $input_type = $sub_components[1]; |
686 | 678 | } elseif ( $sub_components[0] == 'default' ) { |
687 | | - $default_value = $wgParser->recursiveTagParse( $sub_components[1] ); |
| 679 | + $default_value = $parser->recursiveTagParse( $sub_components[1] ); |
688 | 680 | } elseif ( $sub_components[0] == 'preload' ) { |
689 | 681 | // free text field has special handling |
690 | 682 | if ( $field_name == 'free text' || $field_name == '<freetext>' ) { |
— | — | @@ -1415,8 +1407,7 @@ |
1416 | 1408 | $data_text = $existing_page_content; |
1417 | 1409 | |
1418 | 1410 | if ( !$embedded ) { |
1419 | | - global $wgParser; |
1420 | | - $form_page_title = $wgParser->recursiveTagParse( str_replace( "{{!}}", "|", $form_page_title ) ); |
| 1411 | + $form_page_title = $parser->recursiveTagParse( str_replace( "{{!}}", "|", $form_page_title ) ); |
1421 | 1412 | } else { |
1422 | 1413 | $form_page_title = null; |
1423 | 1414 | } |