* Added revdelete-suppress-text
authorAaron Schulz <aaron@users.mediawiki.org>
Sat, 7 Mar 2009 06:04:39 +0000 (06:04 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sat, 7 Mar 2009 06:04:39 +0000 (06:04 +0000)
* Removed some duplication
* Bolded suppress option

includes/specials/SpecialRevisiondelete.php
languages/messages/MessagesEn.php

index 1341f39..af193dc 100644 (file)
@@ -263,8 +263,11 @@ class RevisionDeleteForm {
                }
                
                $wgOut->addHTML( "</ul>" );
-
+               // 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 = "<b>$line</b>";
+                       $html .= $line;
+               }
+               return $html;
        }
 
        /**
@@ -402,9 +418,12 @@ class RevisionDeleteForm {
                }
                
                $wgOut->addHTML( "</ul>" );
-
+               // 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( "<p>$item</p>" );
                }
@@ -498,8 +514,11 @@ class RevisionDeleteForm {
                }
                
                $wgOut->addHTML( "</ul>" );
-
+               // 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( "<p>$item</p>" );
                }
index 955f035..4b7041f 100644 (file)
@@ -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',