From 689e6d95426921ecf86fbb90885f6272add34ad4 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 7 Mar 2009 06:04:39 +0000 Subject: [PATCH] * Added revdelete-suppress-text * Removed some duplication * Bolded suppress option --- includes/specials/SpecialRevisiondelete.php | 56 +++++++++++++-------- languages/messages/MessagesEn.php | 5 +- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 1341f39628..af193dcefd 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -263,8 +263,11 @@ class RevisionDeleteForm { } $wgOut->addHTML( "" ); - + // Explanation text $wgOut->addWikiMsg( 'revdelete-text' ); + if( $wgUser->isAllowed( 'hiderevision' ) ) { + $wgOut->addWikiMsg( 'revdelete-suppress-text' ); + } // Normal sysops can always see what they did, but can't always change it if( !$UserAllowed ) return; @@ -292,11 +295,8 @@ class RevisionDeleteForm { Xml::openElement( 'fieldset' ) . xml::element( 'legend', null, wfMsg( 'revdelete-legend' ) ) ); - // FIXME: all items checked for just one rev are checked, even if not set for the others - foreach( $this->checks as $item ) { - list( $message, $name, $field ) = $item; - $wgOut->addHTML( Xml::tags( 'div', null, Xml::checkLabel( wfMsg( $message ), $name, $name, $bitfields & $field ) ) ); - } + + $wgOut->addHTML( $this->buildCheckBoxes( $bitfields ) ); foreach( $items as $item ) { $wgOut->addHTML( Xml::tags( 'p', null, $item ) ); } @@ -307,7 +307,23 @@ class RevisionDeleteForm { Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' ) . "\n" ); - + } + + /** + * @param int $bitfields, aggregate bitfield of all the bitfields + * @returns string HTML + */ + private function buildCheckBoxes( $bitfields ) { + $html = ''; + // FIXME: all items checked for just one rev are checked, even if not set for the others + foreach( $this->checks as $item ) { + list( $message, $name, $field ) = $item; + $line = Xml::tags( 'div', null, Xml::checkLabel( wfMsg($message), $name, $name, + $bitfields & $field ) ); + if( $field == Revision::DELETED_RESTRICTED ) $line = "$line"; + $html .= $line; + } + return $html; } /** @@ -402,9 +418,12 @@ class RevisionDeleteForm { } $wgOut->addHTML( "" ); - + // Explanation text $wgOut->addWikiMsg('revdelete-text' ); - //Normal sysops can always see what they did, but can't always change it + if( $wgUser->isAllowed( 'hiderevision' ) ) { + $wgOut->addWikiMsg( 'revdelete-suppress-text' ); + } + // Normal sysops can always see what they did, but can't always change it if( !$UserAllowed ) return; $items = array( @@ -429,11 +448,8 @@ class RevisionDeleteForm { 'id' => 'mw-revdel-form-filerevisions' ) ) . Xml::fieldset( wfMsg( 'revdelete-legend' ) ) ); - // FIXME: all items checked for just one file are checked, even if not set for the others - foreach( $this->checks as $item ) { - list( $message, $name, $field ) = $item; - $wgOut->addHTML( Xml::tags( 'div', null, Xml::checkLabel( wfMsg( $message ), $name, $name, $bitfields & $field ) ) ); - } + + $wgOut->addHTML( $this->buildCheckBoxes( $bitfields ) ); foreach( $items as $item ) { $wgOut->addHTML( "

$item

" ); } @@ -498,8 +514,11 @@ class RevisionDeleteForm { } $wgOut->addHTML( "" ); - + // Explanation text $wgOut->addWikiMsg( 'revdelete-text' ); + if( $wgUser->isAllowed( 'hiderevision' ) ) { + $wgOut->addWikiMsg( 'revdelete-suppress-text' ); + } // Normal sysops can always see what they did, but can't always change it if( !$UserAllowed ) return; @@ -520,11 +539,8 @@ class RevisionDeleteForm { 'id' => 'mw-revdel-form-logs' ) ) . Xml::fieldset( wfMsg( 'revdelete-legend' ) ) ); - // FIXME: all items checked for just on event are checked, even if not set for the others - foreach( $this->checks as $item ) { - list( $message, $name, $field ) = $item; - $wgOut->addHTML( Xml::tags( 'div', null, Xml::checkLabel( wfMsg( $message ), $name, $name, $bitfields & $field ) ) ); - } + + $wgOut->addHTML( $this->buildCheckBoxes( $bitfields ) ); foreach( $items as $item ) { $wgOut->addHTML( "

$item

" ); } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 955f035d96..4b7041fafc 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1315,12 +1315,15 @@ function, the specified revision does not exist, or you are attempting to hide t Other administrators on {{SITENAME}} will still be able to access the hidden content and can undelete it again through this same interface, unless additional restrictions are set. Please confirm that you intend to do this, that you understand the consequences, and that you are doing this in accordance with [[{{MediaWiki:Policy-url}}|the policy]].", +'revdelete-suppress-text' => 'Suppression should \'\'\'only\'\'\' be used for the following cases: +* Inappropriate personal information +*: \'\'home addresses and telephone numbers, social security numbers, etc\'\'', 'revdelete-legend' => 'Set visibility restrictions', 'revdelete-hide-text' => 'Hide revision text', 'revdelete-hide-name' => 'Hide action and target', 'revdelete-hide-comment' => 'Hide edit comment', 'revdelete-hide-user' => "Hide editor's username/IP", -'revdelete-hide-restricted' => 'Apply these restrictions to administrators and lock this interface', +'revdelete-hide-restricted' => 'Suppress data from administrators as well as others', 'revdelete-suppress' => 'Suppress data from administrators as well as others', 'revdelete-hide-image' => 'Hide file content', 'revdelete-unsuppress' => 'Remove restrictions on restored revisions', -- 2.20.1