r48118 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48117‎ | r48118 | r48119 >
Date:06:04, 7 March 2009
Author:aaron
Status:resolved (Comments)
Tags:
Comment:
* Added revdelete-suppress-text
* Removed some duplication
* Bolded suppress option
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php
@@ -263,8 +263,11 @@
264264 }
265265
266266 $wgOut->addHTML( "</ul>" );
267 -
 267+ // Explanation text
268268 $wgOut->addWikiMsg( 'revdelete-text' );
 269+ if( $wgUser->isAllowed( 'hiderevision' ) ) {
 270+ $wgOut->addWikiMsg( 'revdelete-suppress-text' );
 271+ }
269272
270273 // Normal sysops can always see what they did, but can't always change it
271274 if( !$UserAllowed ) return;
@@ -292,11 +295,8 @@
293296 Xml::openElement( 'fieldset' ) .
294297 xml::element( 'legend', null, wfMsg( 'revdelete-legend' ) )
295298 );
296 - // FIXME: all items checked for just one rev are checked, even if not set for the others
297 - foreach( $this->checks as $item ) {
298 - list( $message, $name, $field ) = $item;
299 - $wgOut->addHTML( Xml::tags( 'div', null, Xml::checkLabel( wfMsg( $message ), $name, $name, $bitfields & $field ) ) );
300 - }
 299+
 300+ $wgOut->addHTML( $this->buildCheckBoxes( $bitfields ) );
301301 foreach( $items as $item ) {
302302 $wgOut->addHTML( Xml::tags( 'p', null, $item ) );
303303 }
@@ -307,8 +307,24 @@
308308 Xml::closeElement( 'fieldset' ) .
309309 Xml::closeElement( 'form' ) . "\n"
310310 );
311 -
312311 }
 312+
 313+ /**
 314+ * @param int $bitfields, aggregate bitfield of all the bitfields
 315+ * @returns string HTML
 316+ */
 317+ private function buildCheckBoxes( $bitfields ) {
 318+ $html = '';
 319+ // FIXME: all items checked for just one rev are checked, even if not set for the others
 320+ foreach( $this->checks as $item ) {
 321+ list( $message, $name, $field ) = $item;
 322+ $line = Xml::tags( 'div', null, Xml::checkLabel( wfMsg($message), $name, $name,
 323+ $bitfields & $field ) );
 324+ if( $field == Revision::DELETED_RESTRICTED ) $line = "<b>$line</b>";
 325+ $html .= $line;
 326+ }
 327+ return $html;
 328+ }
313329
314330 /**
315331 * This lets a user set restrictions for archived images
@@ -402,9 +418,12 @@
403419 }
404420
405421 $wgOut->addHTML( "</ul>" );
406 -
 422+ // Explanation text
407423 $wgOut->addWikiMsg('revdelete-text' );
408 - //Normal sysops can always see what they did, but can't always change it
 424+ if( $wgUser->isAllowed( 'hiderevision' ) ) {
 425+ $wgOut->addWikiMsg( 'revdelete-suppress-text' );
 426+ }
 427+ // Normal sysops can always see what they did, but can't always change it
409428 if( !$UserAllowed ) return;
410429
411430 $items = array(
@@ -429,11 +448,8 @@
430449 'id' => 'mw-revdel-form-filerevisions' ) ) .
431450 Xml::fieldset( wfMsg( 'revdelete-legend' ) )
432451 );
433 - // FIXME: all items checked for just one file are checked, even if not set for the others
434 - foreach( $this->checks as $item ) {
435 - list( $message, $name, $field ) = $item;
436 - $wgOut->addHTML( Xml::tags( 'div', null, Xml::checkLabel( wfMsg( $message ), $name, $name, $bitfields & $field ) ) );
437 - }
 452+
 453+ $wgOut->addHTML( $this->buildCheckBoxes( $bitfields ) );
438454 foreach( $items as $item ) {
439455 $wgOut->addHTML( "<p>$item</p>" );
440456 }
@@ -498,8 +514,11 @@
499515 }
500516
501517 $wgOut->addHTML( "</ul>" );
502 -
 518+ // Explanation text
503519 $wgOut->addWikiMsg( 'revdelete-text' );
 520+ if( $wgUser->isAllowed( 'hiderevision' ) ) {
 521+ $wgOut->addWikiMsg( 'revdelete-suppress-text' );
 522+ }
504523 // Normal sysops can always see what they did, but can't always change it
505524 if( !$UserAllowed ) return;
506525
@@ -520,11 +539,8 @@
521540 'id' => 'mw-revdel-form-logs' ) ) .
522541 Xml::fieldset( wfMsg( 'revdelete-legend' ) )
523542 );
524 - // FIXME: all items checked for just on event are checked, even if not set for the others
525 - foreach( $this->checks as $item ) {
526 - list( $message, $name, $field ) = $item;
527 - $wgOut->addHTML( Xml::tags( 'div', null, Xml::checkLabel( wfMsg( $message ), $name, $name, $bitfields & $field ) ) );
528 - }
 543+
 544+ $wgOut->addHTML( $this->buildCheckBoxes( $bitfields ) );
529545 foreach( $items as $item ) {
530546 $wgOut->addHTML( "<p>$item</p>" );
531547 }
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1315,12 +1315,15 @@
13161316 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.
13171317
13181318 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]].",
 1319+'revdelete-suppress-text' => 'Suppression should \'\'\'only\'\'\' be used for the following cases:
 1320+* Inappropriate personal information
 1321+*: \'\'home addresses and telephone numbers, social security numbers, etc\'\'',
13191322 'revdelete-legend' => 'Set visibility restrictions',
13201323 'revdelete-hide-text' => 'Hide revision text',
13211324 'revdelete-hide-name' => 'Hide action and target',
13221325 'revdelete-hide-comment' => 'Hide edit comment',
13231326 'revdelete-hide-user' => "Hide editor's username/IP",
1324 -'revdelete-hide-restricted' => 'Apply these restrictions to administrators and lock this interface',
 1327+'revdelete-hide-restricted' => 'Suppress data from administrators as well as others',
13251328 'revdelete-suppress' => 'Suppress data from administrators as well as others',
13261329 'revdelete-hide-image' => 'Hide file content',
13271330 'revdelete-unsuppress' => 'Remove restrictions on restored revisions',

Comments

#Comment by Aaron Schulz (talk | contribs)   20:15, 8 March 2009

Right was renamed to suppressrevision a while back. Fixed in r48160.

Status & tagging log