dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Skin: Add new hook, UndeletePageToolLinks, for Special:Undelete views"
[lhc/web/wiklou.git]
/
includes
/
FileDeleteForm.php
diff --git
a/includes/FileDeleteForm.php
b/includes/FileDeleteForm.php
index
c362ec0
..
8272ccf
100644
(file)
--- a/
includes/FileDeleteForm.php
+++ b/
includes/FileDeleteForm.php
@@
-79,7
+79,9
@@
class FileDeleteForm {
$this->oldimage = $wgRequest->getText( 'oldimage', false );
$token = $wgRequest->getText( 'wpEditToken' );
# Flag to hide all contents of the archived revisions
$this->oldimage = $wgRequest->getText( 'oldimage', false );
$token = $wgRequest->getText( 'wpEditToken' );
# Flag to hide all contents of the archived revisions
- $suppress = $wgRequest->getCheck( 'wpSuppress' ) && $wgUser->isAllowed( 'suppressrevision' );
+ $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
+ $suppress = $wgRequest->getCheck( 'wpSuppress' ) &&
+ $permissionManager->userHasRight( $wgUser, 'suppressrevision' );
if ( $this->oldimage ) {
$this->oldfile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName(
if ( $this->oldimage ) {
$this->oldfile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName(
@@
-120,9
+122,10
@@
class FileDeleteForm {
if ( !$status->isGood() ) {
$wgOut->addHTML( '<h2>' . $this->prepareMessage( 'filedeleteerror-short' ) . "</h2>\n" );
if ( !$status->isGood() ) {
$wgOut->addHTML( '<h2>' . $this->prepareMessage( 'filedeleteerror-short' ) . "</h2>\n" );
- $wgOut->addWikiText( '<div class="error">' .
+ $wgOut->wrapWikiTextAsInterface(
+ 'error',
$status->getWikiText( 'filedeleteerror-short', 'filedeleteerror-long' )
$status->getWikiText( 'filedeleteerror-short', 'filedeleteerror-long' )
-
. '</div>'
);
+ );
}
if ( $status->isOK() ) {
$wgOut->setPageTitle( wfMessage( 'actioncomplete' ) );
}
if ( $status->isOK() ) {
$wgOut->setPageTitle( wfMessage( 'actioncomplete' ) );
@@
-228,7
+231,6
@@
class FileDeleteForm {
$lbFactory->rollbackMasterChanges( __METHOD__ );
}
} else {
$lbFactory->rollbackMasterChanges( __METHOD__ );
}
} else {
- // Done; nothing changed
$dbw->endAtomic( __METHOD__ );
}
}
$dbw->endAtomic( __METHOD__ );
}
}
@@
-245,9
+247,7
@@
class FileDeleteForm {
*/
private function showForm() {
global $wgOut, $wgUser, $wgRequest;
*/
private function showForm() {
global $wgOut, $wgUser, $wgRequest;
-
- $conf = RequestContext::getMain()->getConfig();
- $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD;
+ $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
$wgOut->addModules( 'mediawiki.action.delete.file' );
$wgOut->addModules( 'mediawiki.action.delete.file' );
@@
-282,13
+282,13
@@
class FileDeleteForm {
// HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
// (e.g. emojis) count for two each. This limit is overridden in JS to instead count
// HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
// (e.g. emojis) count for two each. This limit is overridden in JS to instead count
- // Unicode codepoints
(or 255 UTF-8 bytes for old schema)
.
+ // Unicode codepoints.
$fields[] = new OOUI\FieldLayout(
new OOUI\TextInputWidget( [
'name' => 'wpReason',
'inputId' => 'wpReason',
'tabIndex' => 2,
$fields[] = new OOUI\FieldLayout(
new OOUI\TextInputWidget( [
'name' => 'wpReason',
'inputId' => 'wpReason',
'tabIndex' => 2,
- 'maxLength' =>
$oldCommentSchema ? 255 :
CommentStore::COMMENT_CHARACTER_LIMIT,
+ 'maxLength' => CommentStore::COMMENT_CHARACTER_LIMIT,
'infusable' => true,
'value' => $wgRequest->getText( 'wpReason' ),
'autofocus' => true,
'infusable' => true,
'value' => $wgRequest->getText( 'wpReason' ),
'autofocus' => true,
@@
-299,7
+299,7
@@
class FileDeleteForm {
]
);
]
);
- if ( $
wgUser->isAllowed(
'suppressrevision' ) ) {
+ if ( $
permissionManager->userHasRight( $wgUser,
'suppressrevision' ) ) {
$fields[] = new OOUI\FieldLayout(
new OOUI\CheckboxInputWidget( [
'name' => 'wpSuppress',
$fields[] = new OOUI\FieldLayout(
new OOUI\CheckboxInputWidget( [
'name' => 'wpSuppress',
@@
-373,7
+373,7
@@
class FileDeleteForm {
] )
);
] )
);
- if ( $
wgUser->isAllowed(
'editinterface' ) ) {
+ if ( $
permissionManager->userHasRight( $wgUser,
'editinterface' ) ) {
$linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
$link = $linkRenderer->makeKnownLink(
$wgOut->msg( 'filedelete-reason-dropdown' )->inContentLanguage()->getTitle(),
$linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
$link = $linkRenderer->makeKnownLink(
$wgOut->msg( 'filedelete-reason-dropdown' )->inContentLanguage()->getTitle(),