r97888 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97887‎ | r97888 | r97889 >
Date:05:50, 23 September 2011
Author:yaron
Status:deferred
Tags:
Comment:
Follow-up to r96581 - added additional patch from LY Meng to fix display of "label" fieldset
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
@@ -543,8 +543,8 @@
544544 // template.
545545 if ( $old_template_name != $template_name ) {
546546 if ( isset( $template_label ) ) {
547 - $form_text .= "<fieldset>\n";
548 - $form_text .= "<legend>$template_label</legend>\n";
 547+ $multipleTemplateString .= "<fieldset>\n";
 548+ $multipleTemplateString .= "<legend>$template_label</legend>\n";
549549 }
550550 // If $curPlaceholder is set, it means we want to insert a
551551 // multiple template form's HTML into the main form's HTML.
@@ -552,11 +552,11 @@
553553 if ($allow_multiple) {
554554 $multipleTemplateString .= "\t" . '<div class="multipleTemplateWrapper">' . "\n";
555555 $multipleTemplateString .= "\t" . '<div class="multipleTemplateList">' . "\n";
556 - if ( $curPlaceholder == null ) {
557 - $form_text .= $multipleTemplateString;
558 - }
559556 }
560557 }
 558+ if ( $curPlaceholder == null ) {
 559+ $form_text .= $multipleTemplateString;
 560+ }
561561 $template_text .= "{{" . $template_name;
562562 $all_fields = $tif->getAllFields();
563563 // remove template tag
@@ -719,7 +719,7 @@
720720 // Remove this tag, reset some variables, and close off form HTML tag.
721721 $section = substr_replace( $section, '', $brackets_loc, $brackets_end_loc + 3 - $brackets_loc );
722722 $template_name = null;
723 - if ( isset( $template_label ) ) {
 723+ if ( isset( $template_label ) && $curPlaceholder == null ) {
724724 $form_text .= "</fieldset>\n";
725725 unset ( $template_label );
726726 }
@@ -1424,6 +1424,10 @@
14251425 // current placeholder tag, but also add another
14261426 // placeholder tag, to keep track of it.
14271427 $multipleTemplateString .= self::makePlaceholderInFormHTML( $curPlaceholder );
 1428+ if ( isset( $template_label ) ) {
 1429+ $multipleTemplateString .= "</fieldset>\n";
 1430+ unset ( $template_label );
 1431+ }
14281432 $form_text = preg_replace( '/' . self::makePlaceholderInFormHTML( $curPlaceholder ) . '/',
14291433 $multipleTemplateString, $form_text );
14301434 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96581Added (slightly modified) patch from LY Meng to allow multiple-instance templ...yaron16:22, 8 September 2011