r53333 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53332‎ | r53333 | r53334 >
Date:21:13, 15 July 2009
Author:dale
Status:resolved
Tags:
Comment:
SpecialUpload page fixes related to notes on r53282 (xml function usage)
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -589,12 +589,10 @@
590590 }
591591 //add the wpEditToken
592592 $token = htmlspecialchars( $wgUser->editToken() );
593 - $tokenInput = "\n<input type='hidden' value=\"$token\" name=\"wpEditToken\" />\n";
594 -
595593 $wgOut->addHTML(
596594 Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL( 'action=submit' ),
597595 'enctype' => 'multipart/form-data', 'id' => 'uploadwarning' ) ) . "\n" .
598 - $tokenInput .
 596+ Xml::hidden('wpEditToken', $token) .
599597 Xml::hidden( 'wpIgnoreWarning', '1' ) . "\n" .
600598 Xml::hidden( 'wpSourceType', 'stash' ) . "\n" .
601599 Xml::hidden( 'wpSessionKey', $this->mSessionKey ) . "\n" .
@@ -778,14 +776,14 @@
779777 if( UploadFromUrl::isEnabled() && $wgUser->isAllowed( 'upload_by_url' ) ) {
780778 if($wgEnableJS2system){
781779 $filename_form =
782 - "<input type='radio' id=\"wpSourceTypeFile\" name='wpSourceType' value='file' checked='checked' />" .
783 - "<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' size='60' />" .
784 - wfMsgHTML( 'upload_source_file' ) . "<br/>" .
785 - "<input type='radio' id='wpSourceTypeURL' name='wpSourceType' value='url' />" .
786 - "<input tabindex='1' type='text' name='wpUploadFileURL' id='wpUploadFileURL' size='60' />" .
 780+ Xml::input( 'wpSourceType', false, 'file', array( 'id'=>'wpSourceTypeFile', 'type' => 'radio', 'checked' => 'checked' ) ) .
 781+ Xml::input( 'wpUploadFile', 60, false, array( 'id'=>'wpUploadFile', 'type'=>'file', 'tabindex' => '1' ) ) .
 782+ wfMsgHTML( 'upload_source_file' ) . "<br/>" .
 783+ Xml::input( 'wpSourceType', false, 'Url', array( 'id'=>'wpSourceTypeURL', 'type' => 'radio' )) .
 784+ Xml::input( 'wpUploadFileURL', 60, false, array( 'id'=>'wpUploadFileURL', 'type' => 'text', 'tabindex' => '1')) .
787785 wfMsgHtml( 'upload_source_url' ) ;
788786 }else{
789 - //@@todo depreciate (only support JS2system)
 787+ //@@todo depreciate (not needed once $wgEnableJS2system is turned on)
790788 $filename_form =
791789 "<input type='radio' id='wpSourceTypeFile' name='wpSourceType' value='file' " .
792790 "onchange='toggle_element_activation(\"wpUploadFileURL\",\"wpUploadFile\")' checked='checked' />" .
@@ -825,12 +823,10 @@
826824
827825 //add the wpEditToken
828826 $token = htmlspecialchars( $wgUser->editToken() );
829 - $tokenInput = "\n<input type='hidden' value=\"$token\" name=\"wpEditToken\" />\n";
830 -
831827 $wgOut->addHTML(
832828 Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL( 'action=submit' ),
833829 'enctype' => 'multipart/form-data', 'id' => 'mw-upload-form' ) ) .
834 - $tokenInput .
 830+ Xml::hidden('wpEditToken', $token) .
835831 Xml::openElement( 'fieldset' ) .
836832 Xml::element( 'legend', null, wfMsg( 'upload' ) ) .
837833 Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-upload-table' ) ) .

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r53282here it is ... the upload-api, script-server, js2 (javascript phase2) branch ...dale23:52, 14 July 2009

Status & tagging log