Merge "Split reason dropdown list on Special:RevisionDelete"

This commit is contained in:
jenkins-bot 2019-10-07 19:44:32 +00:00 committed by Gerrit Code Review
commit ba1358910d
3 changed files with 27 additions and 3 deletions

View file

@ -436,10 +436,19 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
// Show form if the user can submit
if ( $this->mIsAllowed ) {
$suppressAllowed = $this->permissionManager
->userHasRight( $this->getUser(), 'suppressrevision' );
$out->addModules( [ 'mediawiki.special.revisionDelete' ] );
$out->addModuleStyles( [ 'mediawiki.special',
'mediawiki.interface.helpers.styles' ] );
$dropDownReason = $this->msg( 'revdelete-reason-dropdown' )->inContentLanguage()->text();
// Add additional specific reasons for suppress
if ( $suppressAllowed ) {
$dropDownReason .= "\n" . $this->msg( 'revdelete-reason-dropdown-suppress' )
->inContentLanguage()->text();
}
$form = Xml::openElement( 'form', [ 'method' => 'post',
'action' => $this->getPageTitle()->getLocalURL( [ 'action' => 'submit' ] ),
'id' => 'mw-revdel-form-revisions' ] ) .
@ -452,7 +461,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
'</td>' .
'<td class="mw-input">' .
Xml::listDropDown( 'wpRevDeleteReasonList',
$this->msg( 'revdelete-reason-dropdown' )->inContentLanguage()->text(),
$dropDownReason,
$this->msg( 'revdelete-reasonotherlist' )->inContentLanguage()->text(),
$this->getRequest()->getText( 'wpRevDeleteReasonList', 'other' ), 'wpReasonDropDown'
) .
@ -490,7 +499,18 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
->getPermissionManager()
->userHasRight( $this->getUser(), 'editinterface' )
) {
$link = $this->getLinkRenderer()->makeKnownLink(
$link = '';
$linkRenderer = $this->getLinkRenderer();
if ( $suppressAllowed ) {
$link .= $linkRenderer->makeKnownLink(
$this->msg( 'revdelete-reason-dropdown-suppress' )->inContentLanguage()->getTitle(),
$this->msg( 'revdelete-edit-reasonlist-suppress' )->text(),
[],
[ 'action' => 'edit' ]
);
$link .= $this->msg( 'pipe-separator' )->escaped();
}
$link .= $linkRenderer->makeKnownLink(
$this->msg( 'revdelete-reason-dropdown' )->inContentLanguage()->getTitle(),
$this->msg( 'revdelete-edit-reasonlist' )->text(),
[],

View file

@ -918,10 +918,12 @@
"revdelete-no-change": "<strong>Warning:</strong> The item dated $2, $1 already had the requested visibility settings.",
"revdelete-concurrent-change": "Error modifying the item dated $2, $1: Its status appears to have been changed by someone else while you attempted to modify it.\nPlease check the logs.",
"revdelete-only-restricted": "Error hiding the item dated $2, $1: You cannot suppress items from view by administrators without also selecting one of the other visibility options.",
"revdelete-reason-dropdown": "*Common delete reasons\n** Copyright violation\n** Inappropriate comment or personal information\n** Inappropriate username\n** Potentially libelous information",
"revdelete-reason-dropdown": "*Common delete reasons\n** Copyright violation\n** Inappropriate comment\n** Inappropriate username\n** Potentially libelous information",
"revdelete-reason-dropdown-suppress": "*Common suppress reasons\n** Inappropriate personal information",
"revdelete-otherreason": "Other/additional reason:",
"revdelete-reasonotherlist": "Other reason",
"revdelete-edit-reasonlist": "Edit delete reasons",
"revdelete-edit-reasonlist-suppress": "Edit suppress reasons",
"revdelete-offender": "Revision author:",
"suppressionlog": "Suppression log",
"suppressionlogtext": "Below is a list of deletions and blocks involving content hidden from administrators.\nSee the [[Special:BlockList|block list]] for the list of currently operational bans and blocks.",

View file

@ -1131,9 +1131,11 @@
"revdelete-concurrent-change": "{{RevisionDelete}}\nParameters:\n* $1 - a date\n* $2 - a time\n{{Related|Revdelete}}",
"revdelete-only-restricted": "{{RevisionDelete}}\nParameters:\n*$1 - date\n*$2 - time\n{{Related|Revdelete}}",
"revdelete-reason-dropdown": "{{RevisionDelete}}\nUsed as item list for dropdown.\n[[File:RevDelete Special-RevisionDelete (r60428).png|frame|center|Screenshot of the interface]]\n\nSee also:\n* {{msg-mw|Revdelete-legend|legend for the form}}\n* {{msg-mw|Revdelete-log|label for dropdown}}\n* {{msg-mw|Revdelete-reasonotherlist|item in dropdown}}\n* {{msg-mw|Revdelete-otherreason|label for input box}}\n* {{msg-mw|Revdelete-submit|submit button}}",
"revdelete-reason-dropdown-suppress": "{{RevisionDelete}}\nUsed as item list for dropdown.\n[[File:RevDelete Special-RevisionDelete (r60428).png|frame|center|Screenshot of the interface]]\n\nSee also:\n* {{msg-mw|Revdelete-legend|legend for the form}}\n* {{msg-mw|Revdelete-log|label for dropdown}}\n* {{msg-mw|Revdelete-reasonotherlist|item in dropdown}}\n* {{msg-mw|Revdelete-otherreason|label for input box}}\n* {{msg-mw|Revdelete-submit|submit button}}",
"revdelete-otherreason": "{{Identical|Other/additional reason}}\n{{RevisionDelete}}\nUsed as label for input box.\n[[File:RevDelete Special-RevisionDelete (r60428).png|frame|center|Screenshot of the interface]]\n\nSee also:\n* {{msg-mw|Revdelete-legend|legend for the form}}\n* {{msg-mw|Revdelete-log|label for dropdown}}\n* {{msg-mw|Revdelete-reason-dropdown|item list for dropdown|notext=1}}\n* {{msg-mw|Revdelete-reasonotherlist|item in dropdown}}\n* {{msg-mw|Revdelete-submit|submit button}}",
"revdelete-reasonotherlist": "{{RevisionDelete}}\nUsed as an item in dropdown.\n[[File:RevDelete Special-RevisionDelete (r60428).png|frame|center|Screenshot of the interface]]\nSee also:\n* {{msg-mw|Revdelete-legend|legend for the form}}\n* {{msg-mw|Revdelete-log|label for dropdown}}\n* {{msg-mw|Revdelete-reason-dropdown|item list for dropdown|notext=1}}\n* {{msg-mw|Revdelete-otherreason|label for input box}}\n* {{msg-mw|Revdelete-submit|submit button}}\n{{Identical|Other reason}}",
"revdelete-edit-reasonlist": "{{Identical|Edit delete reasons}}\n{{RevisionDelete}}\n[[File:RevDelete Special-RevisionDelete (r60428).png|frame|center|Screenshot of the interface]]",
"revdelete-edit-reasonlist-suppress": "{{RevisionDelete}}\n[[File:RevDelete Special-RevisionDelete (r60428).png|frame|center|Screenshot of the interface]]",
"revdelete-offender": "Used as label for input box in the form.",
"suppressionlog": "{{doc-logpage}}\n\nTitle of the suppression log. Shown in the drop down menu at [[Special:log]] and as header of [[Special:log/suppress]].",
"suppressionlogtext": "Description text of the suppression log. Shown at top of [[Special:log/suppress]].",