Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc |
— | — | @@ -158,7 +158,7 @@ |
159 | 159 | // remove the '<nowiki>' tags, leaving us with what we need |
160 | 160 | global $sfgDisableWikiTextParsing; |
161 | 161 | if (! $sfgDisableWikiTextParsing) { |
162 | | - $form_def = strtr($form_def, array('{{{' => '<nowiki>{{{', '}}}' => '}}}</nowiki>')); |
| 162 | + $form_def = "__NOEDITSECTION__\n" . strtr($form_def, array('{{{' => '<nowiki>{{{', '}}}' => '}}}</nowiki>')); |
163 | 163 | $wgParser->mOptions = new ParserOptions(); |
164 | 164 | $wgParser->mOptions->initialiseFromUser($wgUser); |
165 | 165 | $form_def = $wgParser->parse($form_def, $this->mPageTitle, $wgParser->mOptions)->getText(); |
— | — | @@ -172,6 +172,11 @@ |
173 | 173 | $free_text_was_included = false; |
174 | 174 | $free_text_preload_page = null; |
175 | 175 | $all_values_for_template = array(); |
| 176 | + // replace HTML-encoded representations of curly brackets with actual |
| 177 | + // curly brackets - this is a hack to allow for forms to include |
| 178 | + // templates that themselves contain form elements - the escaping is |
| 179 | + // needed to make sure that those elements don't get parsed too early |
| 180 | + $form_def = str_replace(array('{', '}'), array('{', '}'), $form_def); |
176 | 181 | while ($brackets_loc = strpos($form_def, "{{{", $start_position)) { |
177 | 182 | $brackets_end_loc = strpos($form_def, "}}}", $brackets_loc); |
178 | 183 | $bracketed_string = substr($form_def, $brackets_loc + 3, $brackets_end_loc - ($brackets_loc + 3)); |
— | — | @@ -505,6 +510,7 @@ |
506 | 511 | $sfgTabIndex++; |
507 | 512 | $sfgFieldNum++; |
508 | 513 | list($new_text, $new_javascript_text) = SFFormInputs::textAreaHTML('<free_text>', 'free_text', false, ($form_is_disabled || $is_restricted), $field_args); |
| 514 | + $fields_javascript_text .= $new_javascript_text; |
509 | 515 | } |
510 | 516 | $free_text_was_included = true; |
511 | 517 | // add a similar placeholder to the data text |