From 9351fe9adae1f827231f0ca876ca408da1161383 Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Wed, 15 Jul 2009 21:13:49 +0000 Subject: [PATCH] SpecialUpload page fixes related to notes on r53282 (xml function usage) --- includes/specials/SpecialUpload.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 8e789eaf24..f0d0bae904 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -589,12 +589,10 @@ class UploadForm extends SpecialPage { } //add the wpEditToken $token = htmlspecialchars( $wgUser->editToken() ); - $tokenInput = "\n\n"; - $wgOut->addHTML( Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL( 'action=submit' ), 'enctype' => 'multipart/form-data', 'id' => 'uploadwarning' ) ) . "\n" . - $tokenInput . + Xml::hidden('wpEditToken', $token) . Xml::hidden( 'wpIgnoreWarning', '1' ) . "\n" . Xml::hidden( 'wpSourceType', 'stash' ) . "\n" . Xml::hidden( 'wpSessionKey', $this->mSessionKey ) . "\n" . @@ -778,14 +776,14 @@ wgUploadAutoFill = {$autofill}; if( UploadFromUrl::isEnabled() && $wgUser->isAllowed( 'upload_by_url' ) ) { if($wgEnableJS2system){ $filename_form = - "" . - "" . - wfMsgHTML( 'upload_source_file' ) . "
" . - "" . - "" . + Xml::input( 'wpSourceType', false, 'file', array( 'id'=>'wpSourceTypeFile', 'type' => 'radio', 'checked' => 'checked' ) ) . + Xml::input( 'wpUploadFile', 60, false, array( 'id'=>'wpUploadFile', 'type'=>'file', 'tabindex' => '1' ) ) . + wfMsgHTML( 'upload_source_file' ) . "
" . + Xml::input( 'wpSourceType', false, 'Url', array( 'id'=>'wpSourceTypeURL', 'type' => 'radio' )) . + Xml::input( 'wpUploadFileURL', 60, false, array( 'id'=>'wpUploadFileURL', 'type' => 'text', 'tabindex' => '1')) . wfMsgHtml( 'upload_source_url' ) ; }else{ - //@@todo depreciate (only support JS2system) + //@@todo depreciate (not needed once $wgEnableJS2system is turned on) $filename_form = "" . @@ -825,12 +823,10 @@ wgUploadAutoFill = {$autofill}; //add the wpEditToken $token = htmlspecialchars( $wgUser->editToken() ); - $tokenInput = "\n\n"; - $wgOut->addHTML( Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL( 'action=submit' ), 'enctype' => 'multipart/form-data', 'id' => 'mw-upload-form' ) ) . - $tokenInput . + Xml::hidden('wpEditToken', $token) . Xml::openElement( 'fieldset' ) . Xml::element( 'legend', null, wfMsg( 'upload' ) ) . Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-upload-table' ) ) . -- 2.20.1