r83032 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83031‎ | r83032 | r83033 >
Date:18:54, 1 March 2011
Author:yaron
Status:deferred
Tags:
Comment:
Replaced some hardcoded HTML with calls to the Xml class
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_FormStart.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php
@@ -85,7 +85,7 @@
8686 }
8787
8888 if ( ( ! $form_title || ! $form_title->exists() ) && ( $form_name != '' ) ) {
89 - $text = '<p>' . htmlspecialchars( wfMsg( 'sf_formstart_badform', SFUtils::linkText( SF_NS_FORM, $form_name ) ) ) . ".</p>\n";
 89+ $text = Xml::element( 'p', null, wfMsg( 'sf_formstart_badform', SFUtils::linkText( SF_NS_FORM, $form_name ) ) ) . "\n";
9090 } else {
9191 if ( $form_name == '' ) {
9292 $description = htmlspecialchars( wfMsg( 'sf_formstart_noform_docu', $form_name ) );
@@ -94,11 +94,10 @@
9595 $description = htmlspecialchars( wfMsg( 'sf_formstart_docu', $form_name ) );
9696 }
9797
98 - $button_text = htmlspecialchars( wfMsg( 'sf_formstart_createoredit' ) );
9998 $text = <<<END
10099 <form action="" method="post">
101100 <p>$description</p>
102 - <p><input type="text" size="40" name="page_name">
 101+ <p><input type="text" size="40" name="page_name" />
103102
104103 END;
105104 // If no form was specified, display a dropdown letting
@@ -106,19 +105,12 @@
107106 if ( $form_name == '' )
108107 $text .= SFUtils::formDropdownHTML();
109108
110 - $hidden_target_namespace = htmlspecialchars( $target_namespace );
111 - $hidden_super_page = htmlspecialchars( $super_page );
112 - $hidden_params = htmlspecialchars( $params );
113 -
114 - $text .= <<<END
115 - </p>
116 - <input type="hidden" name="namespace" value="$hidden_target_namespace">
117 - <input type="hidden" name="super_page" value="$hidden_super_page">
118 - <input type="hidden" name="params" value="$hidden_params">
119 - <input type="Submit" value="$button_text">
120 - </form>
121 -
122 -END;
 109+ $text .= "\t</p>\n";
 110+ $text .= "\t" . Xml::hidden( 'namespace', $target_namespace ) . "\n";
 111+ $text .= "\t" . Xml::hidden( 'super_page', $super_page ) . "\n";
 112+ $text .= "\t" . Xml::hidden( 'params', $params ) . "\n";
 113+ $text .= "\t" . Xml::element( 'input', array( 'type' => 'submit', 'value' => wfMsg( 'sf_formstart_createoredit' ) ) ) . "\n";
 114+ $text .= "\t</form>\n";
123115 }
124116 $wgOut->addHTML( $text );
125117 }