*/
function uploadError( $error ) {
global $wgOut;
- $wgOut->addHTML( "<h2>" . wfMsgHtml( 'uploadwarning' ) . "</h2>\n" );
- $wgOut->addHTML( "<span class='error'>{$error}</span>\n" );
+ $wgOut->addHTML( Xml::element( 'h2', null, wfMsg( 'uploadwarning' ) . "\n" ) );
+ $wgOut->addHTML( Xml::tags( 'span', array( 'class' => 'error' ), $error ) );
}
/**
* @access private
*/
function uploadWarning( $warning ) {
- global $wgOut, $wgContLang;
+ global $wgOut;
global $wgUseCopyrightUpload;
$this->mSessionKey = $this->stashSession();
return;
}
- $wgOut->addHTML( "<h2>" . wfMsgHtml( 'uploadwarning' ) . "</h2>\n" );
- $wgOut->addHTML( "<ul class='warning'>{$warning}</ul><br />\n" );
+ $wgOut->addHTML( Xml::element( 'h2', null, wfMsg( 'uploadwarning' ) ) . "\n" );
+ $wgOut->addHTML( Xml::tags( 'ul', array( 'class' => 'warning' ), $warning ) . "\n" );
- $save = wfMsgHtml( 'savefile' );
- $reupload = wfMsgHtml( 'reupload' );
- $iw = wfMsgWikiHtml( 'ignorewarning' );
- $reup = wfMsgWikiHtml( 'reuploaddesc' );
$titleObj = SpecialPage::getTitleFor( 'Upload' );
- $action = $titleObj->escapeLocalURL( 'action=submit' );
- $align1 = $wgContLang->isRTL() ? 'left' : 'right';
- $align2 = $wgContLang->isRTL() ? 'right' : 'left';
- if ( $wgUseCopyrightUpload )
- {
- $copyright = "
- <input type='hidden' name='wpUploadCopyStatus' value=\"" . htmlspecialchars( $this->mCopyrightStatus ) . "\" />
- <input type='hidden' name='wpUploadSource' value=\"" . htmlspecialchars( $this->mCopyrightSource ) . "\" />
- ";
+ if ( $wgUseCopyrightUpload ) {
+ $copyright = Xml::hidden( 'wpUploadCopyStatus', $this->mCopyrightStatus ) . "\n" .
+ Xml::hidden( 'wpUploadSource', $this->mCopyrightSource ) . "\n";
} else {
- $copyright = "";
+ $copyright = '';
}
- $wgOut->addHTML( "
- <form id='uploadwarning' method='post' enctype='multipart/form-data' action='$action'>
- <input type='hidden' name='wpIgnoreWarning' value='1' />
- <input type='hidden' name='wpSessionKey' value=\"" . htmlspecialchars( $this->mSessionKey ) . "\" />
- <input type='hidden' name='wpUploadDescription' value=\"" . htmlspecialchars( $this->mComment ) . "\" />
- <input type='hidden' name='wpLicense' value=\"" . htmlspecialchars( $this->mLicense ) . "\" />
- <input type='hidden' name='wpDestFile' value=\"" . htmlspecialchars( $this->mDesiredDestName ) . "\" />
- <input type='hidden' name='wpWatchthis' value=\"" . htmlspecialchars( intval( $this->mWatchthis ) ) . "\" />
- {$copyright}
- <table border='0'>
- <tr>
- <tr>
- <td align='$align1'>
- <input tabindex='2' type='submit' name='wpUpload' value=\"$save\" />
- </td>
- <td align='$align2'>$iw</td>
- </tr>
- <tr>
- <td align='$align1'>
- <input tabindex='2' type='submit' name='wpReUpload' value=\"{$reupload}\" />
- </td>
- <td align='$align2'>$reup</td>
- </tr>
- </tr>
- </table></form>\n" );
+ $wgOut->addHTML(
+ Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL( 'action=submit' ),
+ 'enctype' => 'multipart/form-data', 'id' => 'uploadwarning' ) ) . "\n" .
+ Xml::hidden( 'wpIgnoreWarning', '1' ) . "\n" .
+ Xml::hidden( 'wpSessionKey', $this->mSessionKey ) . "\n" .
+ Xml::hidden( 'wpUploadDescription', $this->mComment ) . "\n" .
+ Xml::hidden( 'wpLicense', $this->mLicense ) . "\n" .
+ Xml::hidden( 'wpDestFile', $this->mDesiredDestName ) . "\n" .
+ Xml::hidden( 'wpWatchthis', $this->mWatchthis ) . "\n" .
+ "{$copyright}<br />" .
+ Xml::submitButton( wfMsg( 'ignorewarning' ), array ( 'name' => 'wpUpload', 'id' => 'wpUpload', 'checked' => 'checked' ) ) . ' ' .
+ Xml::submitButton( wfMsg( 'reuploaddesc' ), array ( 'name' => 'wpReUpload', 'id' => 'wpReUpload' ) ) .
+ Xml::closeElement( 'form' ) . "\n"
+ );
}
/**
'upload' => 'Hochladen',
'uploadbtn' => 'Datei hochladen',
'reupload' => 'Abbrechen',
-'reuploaddesc' => 'Zurück zur Hochladen-Seite.',
+'reuploaddesc' => 'Abbrechen und zurück zur Hochladen-Seite',
'uploadnologin' => 'Nicht angemeldet',
'uploadnologintext' => 'Du musst [[Special:Userlogin|angemeldet sein]], um Dateien hochladen zu können.',
'upload_directory_read_only' => 'Der Webserver hat keine Schreibrechte für das Upload-Verzeichnis ($1).',
'filestatus' => 'Copyright-Status:',
'filesource' => 'Quelle:',
'uploadedfiles' => 'Hochgeladene Dateien',
-'ignorewarning' => 'Warnung ignorieren und Datei speichern.',
+'ignorewarning' => 'Warnung ignorieren und Datei speichern',
'ignorewarnings' => 'Warnungen ignorieren',
'minlength1' => 'Dateinamen müssen mindestens einen Buchstaben lang sein.',
'illegalfilename' => 'Der Dateiname „$1“ enthält mindestens ein nicht erlaubtes Zeichen. Bitte benenne die Datei um und versuche sie erneut hochzuladen.',
'upload' => 'Upload file',
'uploadbtn' => 'Upload file',
'reupload' => 'Re-upload',
-'reuploaddesc' => 'Return to the upload form.',
+'reuploaddesc' => 'Cancel upload and return to the upload form',
'uploadnologin' => 'Not logged in',
'uploadnologintext' => 'You must be [[Special:Userlogin|logged in]] to upload files.',
'upload_directory_read_only' => 'The upload directory ($1) is not writable by the webserver.',
'filestatus' => 'Copyright status:',
'filesource' => 'Source:',
'uploadedfiles' => 'Uploaded files',
-'ignorewarning' => 'Ignore warning and save file anyway.',
+'ignorewarning' => 'Ignore warning and save file anyway',
'ignorewarnings' => 'Ignore any warnings',
'minlength1' => 'File names must be at least one letter.',
'illegalfilename' => 'The filename "$1" contains characters that are not allowed in page titles. Please rename the file and try uploading it again.',