Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php |
— | — | @@ -264,10 +264,7 @@ |
265 | 265 | |
266 | 266 | $wgOut->addHTML( "</ul>" ); |
267 | 267 | // Explanation text |
268 | | - $wgOut->addWikiMsg( 'revdelete-text' ); |
269 | | - if( $wgUser->isAllowed( 'hiderevision' ) ) { |
270 | | - $wgOut->addWikiMsg( 'revdelete-suppress-text' ); |
271 | | - } |
| 268 | + $this->addUsageText(); |
272 | 269 | |
273 | 270 | // Normal sysops can always see what they did, but can't always change it |
274 | 271 | if( !$UserAllowed ) return; |
— | — | @@ -308,23 +305,6 @@ |
309 | 306 | Xml::closeElement( 'form' ) . "\n" |
310 | 307 | ); |
311 | 308 | } |
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 | | - } |
329 | 309 | |
330 | 310 | /** |
331 | 311 | * This lets a user set restrictions for archived images |
— | — | @@ -419,10 +399,7 @@ |
420 | 400 | |
421 | 401 | $wgOut->addHTML( "</ul>" ); |
422 | 402 | // Explanation text |
423 | | - $wgOut->addWikiMsg('revdelete-text' ); |
424 | | - if( $wgUser->isAllowed( 'hiderevision' ) ) { |
425 | | - $wgOut->addWikiMsg( 'revdelete-suppress-text' ); |
426 | | - } |
| 403 | + $this->addUsageText(); |
427 | 404 | // Normal sysops can always see what they did, but can't always change it |
428 | 405 | if( !$UserAllowed ) return; |
429 | 406 | |
— | — | @@ -515,10 +492,7 @@ |
516 | 493 | |
517 | 494 | $wgOut->addHTML( "</ul>" ); |
518 | 495 | // Explanation text |
519 | | - $wgOut->addWikiMsg( 'revdelete-text' ); |
520 | | - if( $wgUser->isAllowed( 'hiderevision' ) ) { |
521 | | - $wgOut->addWikiMsg( 'revdelete-suppress-text' ); |
522 | | - } |
| 496 | + $this->addUsageText(); |
523 | 497 | // Normal sysops can always see what they did, but can't always change it |
524 | 498 | if( !$UserAllowed ) return; |
525 | 499 | |
— | — | @@ -553,6 +527,31 @@ |
554 | 528 | Xml::closeElement( 'form' ) . "\n" |
555 | 529 | ); |
556 | 530 | } |
| 531 | + |
| 532 | + private function addUsageText() { |
| 533 | + global $wgOut, $wgUser; |
| 534 | + $wgOut->addWikiMsg( 'revdelete-text' ); |
| 535 | + if( $wgUser->isAllowed( 'hiderevision' ) ) { |
| 536 | + $wgOut->addWikiMsg( 'revdelete-suppress-text' ); |
| 537 | + } |
| 538 | + } |
| 539 | + |
| 540 | + /** |
| 541 | + * @param int $bitfields, aggregate bitfield of all the bitfields |
| 542 | + * @returns string HTML |
| 543 | + */ |
| 544 | + private function buildCheckBoxes( $bitfields ) { |
| 545 | + $html = ''; |
| 546 | + // FIXME: all items checked for just one rev are checked, even if not set for the others |
| 547 | + foreach( $this->checks as $item ) { |
| 548 | + list( $message, $name, $field ) = $item; |
| 549 | + $line = Xml::tags( 'div', null, Xml::checkLabel( wfMsg($message), $name, $name, |
| 550 | + $bitfields & $field ) ); |
| 551 | + if( $field == Revision::DELETED_RESTRICTED ) $line = "<b>$line</b>"; |
| 552 | + $html .= $line; |
| 553 | + } |
| 554 | + return $html; |
| 555 | + } |
557 | 556 | |
558 | 557 | /** |
559 | 558 | * @param Revision $rev |