r44341 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44340‎ | r44341 | r44342 >
Date:15:21, 9 December 2008
Author:raymond
Status:ok
Tags:
Comment:
Per Brions suggestions http://www.mediawiki.org/wiki/Special:Code/MediaWiki/44245#c829
* Append the reason with a colon rather than wrapping in parens
* Rearrange the file-upload portion of the Special:Import form a bit
* Using one message for the comment field since it'll be identical in both parts of the form
More tweaks:
* Add labels for the transwiki import portion too
* Make the forms proper for RTL wikis
Modified paths:
  • /trunk/phase3/includes/specials/SpecialImport.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1939,10 +1939,11 @@
19401940 'import',
19411941 'importinterwiki',
19421942 'import-interwiki-text',
 1943+ 'import-interwiki-source',
19431944 'import-interwiki-history',
19441945 'import-interwiki-submit',
19451946 'import-interwiki-namespace',
1946 - 'import-upload-comment',
 1947+ 'import-upload-filename',
19471948 'import-comment',
19481949 'importtext',
19491950 'importstart',
Index: trunk/phase3/includes/specials/SpecialImport.php
@@ -141,19 +141,25 @@
142142 Xml::openElement( 'table', array( 'id' => 'mw-import-table' ) ) .
143143
144144 "<tr>
145 - <td>" .
146 - Xml::input( 'xmlimport', 50, '', array( 'type' => 'file' ) ) . ' ' .
 145+ <td class='mw-label'>" .
 146+ Xml::label( wfMsg( 'import-upload-filename' ), 'xmlimport' ) .
147147 "</td>
 148+ <td class='mw-input'>" .
 149+ Xml::input( 'xmlimport', 50, '', array( 'type' => 'file' ) ) . ' ' .
 150+ "</td>
148151 </tr>
149152 <tr>
150 - <td>" .
151 - Xml::label( wfMsg('import-upload-comment'), 'log-comment' ) .
152 - Xml::input( 'log-comment', 50, '', array( 'id' => 'log-comment', 'type' => 'text' ) ) . ' ' .
 153+ <td class='mw-label'>" .
 154+ Xml::label( wfMsg( 'import-comment' ), 'log-comment' ) .
153155 "</td>
 156+ <td class='mw-input'>" .
 157+ Xml::input( 'log-comment', 50, '', array( 'id' => 'log-comment', 'type' => 'text' ) ) . ' ' .
 158+ "</td>
154159 </tr>
155160 <tr>
156 - <td>" .
157 - Xml::submitButton( wfMsg( 'uploadbtn' ) ) .
 161+ <td></td>
 162+ <td class='mw-input'>" .
 163+ Xml::submitButton( wfMsg( 'uploadbtn' ) ) .
158164 "</td>
159165 </tr>" .
160166 Xml::closeElement( 'table' ).
@@ -178,7 +184,10 @@
179185 Xml::hidden( 'editToken', $wgUser->editToken() ) .
180186 Xml::openElement( 'table', array( 'id' => 'mw-import-table' ) ) .
181187 "<tr>
182 - <td>" .
 188+ <td class='mw-label'>" .
 189+ Xml::label( wfMsg( 'import-interwiki-source' ), 'interwiki' ) .
 190+ "</td>
 191+ <td class='mw-input'>" .
183192 Xml::openElement( 'select', array( 'name' => 'interwiki' ) )
184193 );
185194 foreach( $wgImportSources as $prefix ) {
@@ -187,38 +196,36 @@
188197 }
189198 $wgOut->addHTML(
190199 Xml::closeElement( 'select' ) .
191 - "</td>
192 - <td>" .
193200 Xml::input( 'frompage', 50, $this->frompage ) .
194201 "</td>
195202 </tr>
196203 <tr>
197204 <td>
198205 </td>
199 - <td>" .
 206+ <td class='mw-input'>" .
200207 Xml::checkLabel( wfMsg( 'import-interwiki-history' ), 'interwikiHistory', 'interwikiHistory', $this->history ) .
201208 "</td>
202209 </tr>
203210 <tr>
204 - <td>
205 - </td>
206211 <td>" .
207212 Xml::label( wfMsg( 'import-interwiki-namespace' ), 'namespace' ) .
 213+ "</td>
 214+ <td class='mw-input'>" .
208215 Xml::namespaceSelector( $this->namespace, '' ) .
209216 "</td>
210217 </tr>
211218 <tr>
212 - <td>" .
 219+ <td class='mw-label'>" .
213220 Xml::label( wfMsg( 'import-comment' ), 'comment' ) .
214221 "</td>
215 - <td>" .
 222+ <td class='mw-input'>" .
216223 Xml::input( 'log-comment', 50, '', array( 'type' => 'text' ) ) . ' ' .
217224 "</td>
218225 </tr>
219226 <tr>
220227 <td>
221228 </td>
222 - <td>" .
 229+ <td class='mw-input'>" .
223230 Xml::submitButton( wfMsg( 'import-interwiki-submit' ), array( 'accesskey' => 's' ) ) .
224231 "</td>
225232 </tr>" .
@@ -270,8 +277,8 @@
271278 if( $this->mIsUpload ) {
272279 $detail = wfMsgExt( 'import-logentry-upload-detail', array( 'content', 'parsemag' ),
273280 $contentCount );
274 - if ($this->reason) {
275 - $detail .= ' (' . $this->reason .')';
 281+ if ( $this->reason ) {
 282+ $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason;
276283 }
277284 $log->addEntry( 'upload', $title, $detail );
278285 } else {
@@ -279,8 +286,8 @@
280287 $origTitle->getPrefixedText() . ']]';
281288 $detail = wfMsgExt( 'import-logentry-interwiki-detail', array( 'content', 'parsemag' ),
282289 $contentCount, $interwiki );
283 - if ($this->reason) {
284 - $detail .= ' (' . $this->reason .')';
 290+ if ( $this->reason ) {
 291+ $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason;
285292 }
286293 $log->addEntry( 'interwiki', $title, $detail );
287294 }
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2788,10 +2788,11 @@
27892789 'import-interwiki-text' => "Select a wiki and page title to import.
27902790 Revision dates and editors' names will be preserved.
27912791 All transwiki import actions are logged at the [[Special:Log/import|import log]].",
 2792+'import-interwiki-source' => 'Source wiki/page:',
27922793 'import-interwiki-history' => 'Copy all history versions for this page',
27932794 'import-interwiki-submit' => 'Import',
2794 -'import-interwiki-namespace' => 'Transfer pages into namespace:',
2795 -'import-upload-comment' => 'Comment:',
 2795+'import-interwiki-namespace' => 'Destination namespace:',
 2796+'import-upload-filename' => 'Filename:',
27962797 'import-comment' => 'Comment:',
27972798 'importtext' => 'Please export the file from the source wiki using the [[Special:Export|export utility]].
27982799 Save it to your computer and upload it here.',

Status & tagging log