Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -589,12 +589,10 @@ |
590 | 590 | } |
591 | 591 | //add the wpEditToken |
592 | 592 | $token = htmlspecialchars( $wgUser->editToken() ); |
593 | | - $tokenInput = "\n<input type='hidden' value=\"$token\" name=\"wpEditToken\" />\n"; |
594 | | - |
595 | 593 | $wgOut->addHTML( |
596 | 594 | Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL( 'action=submit' ), |
597 | 595 | 'enctype' => 'multipart/form-data', 'id' => 'uploadwarning' ) ) . "\n" . |
598 | | - $tokenInput . |
| 596 | + Xml::hidden('wpEditToken', $token) . |
599 | 597 | Xml::hidden( 'wpIgnoreWarning', '1' ) . "\n" . |
600 | 598 | Xml::hidden( 'wpSourceType', 'stash' ) . "\n" . |
601 | 599 | Xml::hidden( 'wpSessionKey', $this->mSessionKey ) . "\n" . |
— | — | @@ -778,14 +776,14 @@ |
779 | 777 | if( UploadFromUrl::isEnabled() && $wgUser->isAllowed( 'upload_by_url' ) ) { |
780 | 778 | if($wgEnableJS2system){ |
781 | 779 | $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')) . |
787 | 785 | wfMsgHtml( 'upload_source_url' ) ; |
788 | 786 | }else{ |
789 | | - //@@todo depreciate (only support JS2system) |
| 787 | + //@@todo depreciate (not needed once $wgEnableJS2system is turned on) |
790 | 788 | $filename_form = |
791 | 789 | "<input type='radio' id='wpSourceTypeFile' name='wpSourceType' value='file' " . |
792 | 790 | "onchange='toggle_element_activation(\"wpUploadFileURL\",\"wpUploadFile\")' checked='checked' />" . |
— | — | @@ -825,12 +823,10 @@ |
826 | 824 | |
827 | 825 | //add the wpEditToken |
828 | 826 | $token = htmlspecialchars( $wgUser->editToken() ); |
829 | | - $tokenInput = "\n<input type='hidden' value=\"$token\" name=\"wpEditToken\" />\n"; |
830 | | - |
831 | 827 | $wgOut->addHTML( |
832 | 828 | Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL( 'action=submit' ), |
833 | 829 | 'enctype' => 'multipart/form-data', 'id' => 'mw-upload-form' ) ) . |
834 | | - $tokenInput . |
| 830 | + Xml::hidden('wpEditToken', $token) . |
835 | 831 | Xml::openElement( 'fieldset' ) . |
836 | 832 | Xml::element( 'legend', null, wfMsg( 'upload' ) ) . |
837 | 833 | Xml::openElement( 'table', array( 'border' => '0', 'id' => 'mw-upload-table' ) ) . |