r90399 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90398‎ | r90399 | r90400 >
Date:16:53, 19 June 2011
Author:yaron
Status:deferred
Tags:
Comment:
Improved HTML display, plus some code formatting
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormClasses.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormClasses.php
@@ -228,8 +228,12 @@
229229 foreach ( $this->fields as $field ) {
230230 $text .= $field->creationHTML( $template_num );
231231 }
232 - $text .= ' <p><input type="submit" name="del_' . $template_num .
233 - '" value="' . wfMsg( 'sf_createform_removetemplate' ) . '"></p>' . "\n";
 232+ $removeTemplateButton = Xml::element( 'input', array(
 233+ 'type' => 'submit',
 234+ 'name' => 'del_' . $template_num,
 235+ 'value' => wfMsg( 'sf_createform_removetemplate' )
 236+ ) );
 237+ $text .= "\t" . Xml::tags( 'p', null, $removeTemplateButton ) . "\n";
234238 $text .= " </div>\n";
235239 return $text;
236240 }
@@ -237,13 +241,16 @@
238242 function createMarkup() {
239243 $text = "";
240244 $text .= "{{{for template|" . $this->template_name;
241 - if ( $this->allow_multiple )
 245+ if ( $this->allow_multiple ) {
242246 $text .= "|multiple";
243 - if ( $this->label != '' )
 247+ }
 248+ if ( $this->label != '' ) {
244249 $text .= "|label=" . $this->label;
 250+ }
245251 $text .= "}}}\n";
246 - // for now, HTML for templates differs for multiple-instance templates;
247 - // this may change if handling of form definitions gets more sophisticated
 252+ // For now, HTML for templates differs for multiple-instance
 253+ // templates; this may change if handling of form definitions
 254+ // gets more sophisticated.
248255 if ( ! $this->allow_multiple ) { $text .= "{| class=\"formtable\"\n"; }
249256 foreach ( $this->fields as $i => $field ) {
250257 $is_last_field = ( $i == count( $this->fields ) - 1 );