Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php |
— | — | @@ -263,8 +263,11 @@ |
264 | 264 | } |
265 | 265 | |
266 | 266 | $wgOut->addHTML( "</ul>" ); |
267 | | - |
| 267 | + // Explanation text |
268 | 268 | $wgOut->addWikiMsg( 'revdelete-text' ); |
| 269 | + if( $wgUser->isAllowed( 'hiderevision' ) ) { |
| 270 | + $wgOut->addWikiMsg( 'revdelete-suppress-text' ); |
| 271 | + } |
269 | 272 | |
270 | 273 | // Normal sysops can always see what they did, but can't always change it |
271 | 274 | if( !$UserAllowed ) return; |
— | — | @@ -292,11 +295,8 @@ |
293 | 296 | Xml::openElement( 'fieldset' ) . |
294 | 297 | xml::element( 'legend', null, wfMsg( 'revdelete-legend' ) ) |
295 | 298 | ); |
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 ) ); |
301 | 301 | foreach( $items as $item ) { |
302 | 302 | $wgOut->addHTML( Xml::tags( 'p', null, $item ) ); |
303 | 303 | } |
— | — | @@ -307,8 +307,24 @@ |
308 | 308 | Xml::closeElement( 'fieldset' ) . |
309 | 309 | Xml::closeElement( 'form' ) . "\n" |
310 | 310 | ); |
311 | | - |
312 | 311 | } |
| 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 | + } |
313 | 329 | |
314 | 330 | /** |
315 | 331 | * This lets a user set restrictions for archived images |
— | — | @@ -402,9 +418,12 @@ |
403 | 419 | } |
404 | 420 | |
405 | 421 | $wgOut->addHTML( "</ul>" ); |
406 | | - |
| 422 | + // Explanation text |
407 | 423 | $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 |
409 | 428 | if( !$UserAllowed ) return; |
410 | 429 | |
411 | 430 | $items = array( |
— | — | @@ -429,11 +448,8 @@ |
430 | 449 | 'id' => 'mw-revdel-form-filerevisions' ) ) . |
431 | 450 | Xml::fieldset( wfMsg( 'revdelete-legend' ) ) |
432 | 451 | ); |
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 ) ); |
438 | 454 | foreach( $items as $item ) { |
439 | 455 | $wgOut->addHTML( "<p>$item</p>" ); |
440 | 456 | } |
— | — | @@ -498,8 +514,11 @@ |
499 | 515 | } |
500 | 516 | |
501 | 517 | $wgOut->addHTML( "</ul>" ); |
502 | | - |
| 518 | + // Explanation text |
503 | 519 | $wgOut->addWikiMsg( 'revdelete-text' ); |
| 520 | + if( $wgUser->isAllowed( 'hiderevision' ) ) { |
| 521 | + $wgOut->addWikiMsg( 'revdelete-suppress-text' ); |
| 522 | + } |
504 | 523 | // Normal sysops can always see what they did, but can't always change it |
505 | 524 | if( !$UserAllowed ) return; |
506 | 525 | |
— | — | @@ -520,11 +539,8 @@ |
521 | 540 | 'id' => 'mw-revdel-form-logs' ) ) . |
522 | 541 | Xml::fieldset( wfMsg( 'revdelete-legend' ) ) |
523 | 542 | ); |
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 ) ); |
529 | 545 | foreach( $items as $item ) { |
530 | 546 | $wgOut->addHTML( "<p>$item</p>" ); |
531 | 547 | } |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1315,12 +1315,15 @@ |
1316 | 1316 | 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. |
1317 | 1317 | |
1318 | 1318 | 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\'\'', |
1319 | 1322 | 'revdelete-legend' => 'Set visibility restrictions', |
1320 | 1323 | 'revdelete-hide-text' => 'Hide revision text', |
1321 | 1324 | 'revdelete-hide-name' => 'Hide action and target', |
1322 | 1325 | 'revdelete-hide-comment' => 'Hide edit comment', |
1323 | 1326 | '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', |
1325 | 1328 | 'revdelete-suppress' => 'Suppress data from administrators as well as others', |
1326 | 1329 | 'revdelete-hide-image' => 'Hide file content', |
1327 | 1330 | 'revdelete-unsuppress' => 'Remove restrictions on restored revisions', |