From: Raimond Spekking Date: Thu, 27 Mar 2008 10:42:58 +0000 (+0000) Subject: Use proper XML functions for upload warning, prettify a bit. X-Git-Tag: 1.31.0-rc.0~48784 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=4b12409823cb5eab8d3f150a021e0e3152ab8a0b;p=lhc%2Fweb%2Fwiklou.git Use proper XML functions for upload warning, prettify a bit. --- diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index 6beb1cb15a..b2017bc7ed 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -832,8 +832,8 @@ class UploadForm { */ function uploadError( $error ) { global $wgOut; - $wgOut->addHTML( "

" . wfMsgHtml( 'uploadwarning' ) . "

\n" ); - $wgOut->addHTML( "{$error}\n" ); + $wgOut->addHTML( Xml::element( 'h2', null, wfMsg( 'uploadwarning' ) . "\n" ) ); + $wgOut->addHTML( Xml::tags( 'span', array( 'class' => 'error' ), $error ) ); } /** @@ -845,7 +845,7 @@ class UploadForm { * @access private */ function uploadWarning( $warning ) { - global $wgOut, $wgContLang; + global $wgOut; global $wgUseCopyrightUpload; $this->mSessionKey = $this->stashSession(); @@ -854,53 +854,32 @@ class UploadForm { return; } - $wgOut->addHTML( "

" . wfMsgHtml( 'uploadwarning' ) . "

\n" ); - $wgOut->addHTML( "
\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 = " - mCopyrightStatus ) . "\" /> - mCopyrightSource ) . "\" /> - "; + if ( $wgUseCopyrightUpload ) { + $copyright = Xml::hidden( 'wpUploadCopyStatus', $this->mCopyrightStatus ) . "\n" . + Xml::hidden( 'wpUploadSource', $this->mCopyrightSource ) . "\n"; } else { - $copyright = ""; + $copyright = ''; } - $wgOut->addHTML( " -
- - mSessionKey ) . "\" /> - mComment ) . "\" /> - mLicense ) . "\" /> - mDesiredDestName ) . "\" /> - mWatchthis ) ) . "\" /> - {$copyright} - - - - - - - - - - - -
- - $iw
- - $reup
\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}
" . + Xml::submitButton( wfMsg( 'ignorewarning' ), array ( 'name' => 'wpUpload', 'id' => 'wpUpload', 'checked' => 'checked' ) ) . ' ' . + Xml::submitButton( wfMsg( 'reuploaddesc' ), array ( 'name' => 'wpReUpload', 'id' => 'wpReUpload' ) ) . + Xml::closeElement( 'form' ) . "\n" + ); } /** diff --git a/languages/messages/MessagesDe.php b/languages/messages/MessagesDe.php index 56dcf1f94a..50815f3d5b 100644 --- a/languages/messages/MessagesDe.php +++ b/languages/messages/MessagesDe.php @@ -1091,7 +1091,7 @@ Wenn du dich mit dem Thema auskennst, kannst du selbst die Seite „[[$1]]“ ve '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).', @@ -1124,7 +1124,7 @@ Bitte beachte, dass, genau wie bei normalen Seiteninhalten, andere Benutzer dein '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.', diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index aca42c790a..7ced83d0ed 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1433,7 +1433,7 @@ Pages on your watchlist are '''bold'''.", '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.', @@ -1459,7 +1459,7 @@ To include a file in a page, use a link in the form '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.',