r75746 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75745‎ | r75746 | r75747 >
Date:20:28, 31 October 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added handling for new "add button text" parameter for multiple-instance templates
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
@@ -330,6 +330,7 @@
331331 $template_name = trim( $tag_components[1] );
332332 $tif->template_name = $template_name;
333333 $query_template_name = str_replace( ' ', '_', $template_name );
 334+ $add_button_text = wfMsg( 'sf_formedit_addanother' );
334335 // also replace periods with underlines, since that's what
335336 // POST does to strings anyway
336337 $query_template_name = str_replace( '.', '_', $query_template_name );
@@ -342,6 +343,8 @@
343344 if ( count( $sub_components ) == 2 ) {
344345 if ( $sub_components[0] == 'label' ) {
345346 $template_label = $sub_components[1];
 347+ } elseif ( $sub_components[0] == 'add button text' ) {
 348+ $add_button_text = $sub_components[1];
346349 }
347350 }
348351 }
@@ -1159,11 +1162,10 @@
11601163 <div id="main_$query_template_name"></div>
11611164
11621165 END;
1163 - $add_another = wfMsg( 'sf_formedit_addanother' );
11641166 $adderID = "adder_$sfgFieldNum";
11651167 $form_text .= <<<END
11661168 <p style="margin-left:10px;">
1167 - <p><input type="button" id="$adderID" value="$add_another" tabindex="$sfgTabIndex" class="addAnother" /></p>
 1169+ <p><input type="button" id="$adderID" value="$add_button_text" tabindex="$sfgTabIndex" class="addAnother" /></p>
11681170
11691171 END;
11701172 $sfgAdderButtons[] = "$adderID,$query_template_name,$sfgFieldNum";

Status & tagging log