r83035 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83034‎ | r83035 | r83036 >
Date:19:20, 1 March 2011
Author:yaron
Status:deferred
Tags:
Comment:
Replaced some hardcoded HTML with calls to the Xml class
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormField.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormField.php
@@ -164,17 +164,21 @@
165165 }
166166
167167 $text .= "<fieldset><legend>Other parameters</legend>\n";
168 - $text .= "<div class=\"otherInputParams\">" . SFCreateForm::showInputTypeOptions( $cur_input_type, $field_form_text, $paramValues ) . "</div>";
 168+ $text .= Xml::tags( 'div', array( 'class' => 'otherInputParams' ),
 169+ SFCreateForm::showInputTypeOptions( $cur_input_type, $field_form_text, $paramValues ) ) . "\n";
169170 $text .= "</fieldset>\n";
170 - $mandatory_checked_str = ( $this->is_mandatory ) ? "checked" : "";
171 - $mandatory_text = wfMsg( 'sf_createform_mandatory' );
172 - $restricted_checked_str = ( $this->is_restricted ) ? "checked" : "";
173 - $restricted_text = wfMsg( 'sf_createform_restricted' );
174171 $text .= <<<END
175172 </p>
176173 <p>
177 - <input type="checkbox" name="mandatory_$field_form_text" value="mandatory" $mandatory_checked_str /> $mandatory_text
178 - <input type="checkbox" name="restricted_$field_form_text" value="restricted" $restricted_checked_str /> $restricted_text</p>
 174+
 175+END;
 176+ $mandatoryCheckboxAtrs = array( 'type' => 'checkbox', 'name' => "mandatory_$field_form_text", 'value' => 'mandatory' );
 177+ if ( $this->is_mandatory ) { $mandatoryCheckboxAtrs['checked'] = 'checked'; }
 178+ $text .= "\t" . Xml::element( 'input', $mandatoryCheckboxAtrs, wfMsg( 'sf_createform_mandatory' ) ) . "\n";
 179+ $restrictedCheckboxAtrs = array( 'type' => 'checkbox', 'name' => "restricted_$field_form_text", 'value' => 'restricted' );
 180+ if ( $this->is_restricted ) { $restrictedCheckboxAtrs['checked'] = 'checked'; }
 181+ $text .= "\t" . Xml::element( 'input', $restrictedCheckboxAtrs, wfMsg( 'sf_createform_restricted' ) ) . "\n";
 182+ $text .= <<<END
179183 </div>
180184 <hr>
181185