X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FFileDeleteForm.php;h=e2fcd9cb15693e83c9dd8747969ce4c29fc82544;hb=8df20e7e476e9917f223aa7c3c9cb03d5fc572ec;hp=1f0c19576436b118a9fc1cd532797f0c187e70f5;hpb=40e93447fc43b163b60f077f9bf9c991bb302307;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php
index 1f0c195764..e2fcd9cb15 100644
--- a/includes/FileDeleteForm.php
+++ b/includes/FileDeleteForm.php
@@ -101,7 +101,8 @@ class FileDeleteForm {
$reason = $deleteReason;
} elseif ( $deleteReason != '' ) {
// Entry from drop down menu + additional comment
- $reason = $deleteReasonList . wfMsgForContent( 'colon-separator' ) . $deleteReason;
+ $reason = $deleteReasonList . wfMessage( 'colon-separator' )
+ ->inContentLanguage()->text() . $deleteReason;
} else {
$reason = $deleteReasonList;
}
@@ -143,6 +144,7 @@ class FileDeleteForm {
* @param $reason String: reason of the deletion
* @param $suppress Boolean: whether to mark all deleted versions as restricted
* @param $user User object performing the request
+ * @throws MWException
* @return bool|Status
*/
public static function doDelete( &$title, &$file, &$oldimage, $reason, $suppress, User $user = null ) {
@@ -156,9 +158,10 @@ class FileDeleteForm {
$status = $file->deleteOld( $oldimage, $reason, $suppress );
if( $status->ok ) {
// Need to do a log item
- $logComment = wfMsgForContent( 'deletedrevision', $oldimage );
+ $logComment = wfMessage( 'deletedrevision', $oldimage )->inContentLanguage()->text();
if( trim( $reason ) != '' ) {
- $logComment .= wfMsgForContent( 'colon-separator' ) . $reason;
+ $logComment .= wfMessage( 'colon-separator' )
+ ->inContentLanguage()->text() . $reason;
}
$logtype = $suppress ? 'suppress' : 'delete';
@@ -214,7 +217,7 @@ class FileDeleteForm {
$suppress = "
|
" .
- Xml::checkLabel( wfMsg( 'revdelete-suppress' ),
+ Xml::checkLabel( wfMessage( 'revdelete-suppress' )->text(),
'wpSuppress', 'wpSuppress', false, array( 'tabindex' => '3' ) ) .
" |
";
@@ -226,23 +229,28 @@ class FileDeleteForm {
$form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction(),
'id' => 'mw-img-deleteconfirm' ) ) .
Xml::openElement( 'fieldset' ) .
- Xml::element( 'legend', null, wfMsg( 'filedelete-legend' ) ) .
+ Xml::element( 'legend', null, wfMessage( 'filedelete-legend' )->text() ) .
Html::hidden( 'wpEditToken', $wgUser->getEditToken( $this->oldimage ) ) .
$this->prepareMessage( 'filedelete-intro' ) .
Xml::openElement( 'table', array( 'id' => 'mw-img-deleteconfirm-table' ) ) .
"
" .
- Xml::label( wfMsg( 'filedelete-comment' ), 'wpDeleteReasonList' ) .
+ Xml::label( wfMessage( 'filedelete-comment' )->text(), 'wpDeleteReasonList' ) .
" |
" .
- Xml::listDropDown( 'wpDeleteReasonList',
- wfMsgForContent( 'filedelete-reason-dropdown' ),
- wfMsgForContent( 'filedelete-reason-otherlist' ), '', 'wpReasonDropDown', 1 ) .
+ Xml::listDropDown(
+ 'wpDeleteReasonList',
+ wfMessage( 'filedelete-reason-dropdown' )->inContentLanguage()->text(),
+ wfMessage( 'filedelete-reason-otherlist' )->inContentLanguage()->text(),
+ '',
+ 'wpReasonDropDown',
+ 1
+ ) .
" |
" .
- Xml::label( wfMsg( 'filedelete-otherreason' ), 'wpReason' ) .
+ Xml::label( wfMessage( 'filedelete-otherreason' )->text(), 'wpReason' ) .
" |
" .
Xml::input( 'wpReason', 60, $wgRequest->getText( 'wpReason' ),
@@ -255,7 +263,7 @@ class FileDeleteForm {
|
|
" .
- Xml::checkLabel( wfMsg( 'watchthis' ),
+ Xml::checkLabel( wfMessage( 'watchthis' )->text(),
'wpWatch', 'wpWatch', $checkWatch, array( 'tabindex' => '3' ) ) .
" |
";
@@ -264,7 +272,7 @@ class FileDeleteForm {
|
" .
- Xml::submitButton( wfMsg( 'filedelete-submit' ),
+ Xml::submitButton( wfMessage( 'filedelete-submit' )->text(),
array( 'name' => 'mw-filedelete-submit', 'id' => 'mw-filedelete-submit', 'tabindex' => '4' ) ) .
" |
" .
@@ -276,7 +284,7 @@ class FileDeleteForm {
$title = Title::makeTitle( NS_MEDIAWIKI, 'Filedelete-reason-dropdown' );
$link = Linker::link(
$title,
- wfMsgHtml( 'filedelete-edit-reasonlist' ),
+ wfMessage( 'filedelete-edit-reasonlist' )->escaped(),
array(),
array( 'action' => 'edit' )
);
@@ -307,19 +315,17 @@ class FileDeleteForm {
private function prepareMessage( $message ) {
global $wgLang;
if( $this->oldimage ) {
- return wfMsgExt(
+ return wfMessage(
"{$message}-old", # To ensure grep will find them: 'filedelete-intro-old', 'filedelete-nofile-old', 'filedelete-success-old'
- 'parse',
wfEscapeWikiText( $this->title->getText() ),
$wgLang->date( $this->getTimestamp(), true ),
$wgLang->time( $this->getTimestamp(), true ),
- wfExpandUrl( $this->file->getArchiveUrl( $this->oldimage ), PROTO_CURRENT ) );
+ wfExpandUrl( $this->file->getArchiveUrl( $this->oldimage ), PROTO_CURRENT ) )->parseAsBlock();
} else {
- return wfMsgExt(
+ return wfMessage(
$message,
- 'parse',
wfEscapeWikiText( $this->title->getText() )
- );
+ )->parseAsBlock();
}
}
@@ -369,8 +375,9 @@ class FileDeleteForm {
$q = array();
$q['action'] = 'delete';
- if( $this->oldimage )
+ if( $this->oldimage ) {
$q['oldimage'] = $this->oldimage;
+ }
return $this->title->getLocalUrl( $q );
}