r83031 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83030‎ | r83031 | r83032 >
Date:18:53, 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_CreateCategory.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_CreateCategory.php
@@ -54,8 +54,6 @@
5555 $default_form = $wgRequest->getVal( 'default_form' );
5656 $parent_category = $wgRequest->getVal( 'parent_category' );
5757
58 - $save_button_text = wfMsg( 'savearticle' );
59 - $preview_button_text = wfMsg( 'preview' );
6058 $category_name_error_str = '';
6159 $save_page = $wgRequest->getCheck( 'wpSave' );
6260 $preview_page = $wgRequest->getCheck( 'wpPreview' );
@@ -84,8 +82,11 @@
8583 $form_label = wfMsg( 'sf_createcategory_defaultform' );
8684 $text = <<<END
8785 <form action="" method="get">
88 - <input type="hidden" name="title" value="$special_namespace:CreateCategory">
89 - <p>$name_label <input size="25" name="category_name" value="">
 86+
 87+END;
 88+ $text .= "\t" . Xml::hidden( 'title', "$special_namespace:CreateCategory" ) . "\n";
 89+ $text .= <<<END
 90+ <p>$name_label <input size="25" name="category_name" value="" />
9091 <span style="color: red;">$category_name_error_str</span>
9192 $form_label
9293 <select id="form_dropdown" name="default_form">
@@ -93,7 +94,7 @@
9495
9596 END;
9697 foreach ( $all_forms as $form ) {
97 - $text .= ' ' . Xml::element( 'option', null, $form ) . "\n";
 98+ $text .= "\t" . Xml::element( 'option', null, $form ) . "\n";
9899 }
99100
100101 $subcategory_label = wfMsg( 'sf_createcategory_makesubcategory' );
@@ -109,14 +110,13 @@
110111 END;
111112 foreach ( $categories as $category ) {
112113 $category = str_replace( '_', ' ', $category );
113 - $text .= " " . Xml::element( 'option', null, $category ) . "\n";
 114+ $text .= "\t" . Xml::element( 'option', null, $category ) . "\n";
114115 }
 116+ $text .= "\t</select>\n";
 117+ $editButtonsText = "\t" . Xml::element( 'input', array( 'type' => 'submit', 'id' => 'wpSave', 'name' => 'wpSave', 'value' => wfMsg( 'savearticle' ) ) ) . "\n";
 118+ $editButtonsText .= "\t" . Xml::element( 'input', array( 'type' => 'submit', 'id' => 'wpPreview', 'name' => 'wpPreview', 'value' => wfMsg( 'preview' ) ) ) . "\n";
 119+ $text .= "\t" . Xml::tags( 'div', array( 'class' => 'editButtons' ), $editButtonsText ) . "\n";
115120 $text .= <<<END
116 - </select>
117 - <div class="editButtons">
118 - <input type="submit" id="wpSave" name="wpSave" value="$save_button_text">
119 - <input type="submit" id="wpPreview" name="wpPreview" value="$preview_button_text">
120 - </div>
121121 <br /><hr /<br />
122122
123123 END;