Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | // Special:Code/MediaWiki/40696 |
5 | 5 | class CodeRevisionView extends CodeView { |
6 | 6 | |
7 | | - protected $showButtonsFormatReference = false; |
| 7 | + protected $showButtonsFormatReference = false, $showButtonsFormatSignoffs = false; |
8 | 8 | |
9 | 9 | /** |
10 | 10 | * @param string|CodeRepository $repo |
— | — | @@ -450,10 +450,15 @@ |
451 | 451 | * @return string HTML |
452 | 452 | */ |
453 | 453 | protected function formatSignoffs( $showButtons ) { |
| 454 | + $this->showButtonsFormatSignoffs = $showButtons; |
454 | 455 | $signoffs = implode( "\n", |
455 | 456 | array_map( array( $this, 'formatSignoffInline' ), $this->mRev->getSignoffs() ) |
456 | 457 | ); |
457 | | - $header = '<th></th>'; |
| 458 | + |
| 459 | + $header = ''; |
| 460 | + if ( $showButtons ) { |
| 461 | + $header = '<th></th>'; |
| 462 | + } |
458 | 463 | $header .= '<th>' . wfMsgHtml( 'code-signoff-field-user' ) . '</th>'; |
459 | 464 | $header .= '<th>' . wfMsgHtml( 'code-signoff-field-flag' ). '</th>'; |
460 | 465 | $header .= '<th>' . wfMsgHtml( 'code-signoff-field-date' ). '</th>'; |
— | — | @@ -509,7 +514,6 @@ |
510 | 515 | */ |
511 | 516 | protected function formatSignoffInline( $signoff ) { |
512 | 517 | global $wgLang; |
513 | | - $checkbox = Html::input( 'wpSignoffs[]', $signoff->getID(), 'checkbox' ); |
514 | 518 | $user = $this->skin->userLink( $signoff->user, $signoff->userText ); |
515 | 519 | $flag = htmlspecialchars( $signoff->flag ); |
516 | 520 | $signoffDate = $wgLang->timeanddate( $signoff->timestamp, true ); |
— | — | @@ -521,7 +525,14 @@ |
522 | 526 | } else { |
523 | 527 | $date = htmlspecialchars( $signoffDate ); |
524 | 528 | } |
525 | | - return "<tr class='$class'><td>$checkbox</td><td>$user</td><td>$flag</td><td>$date</td></tr>"; |
| 529 | + |
| 530 | + $ret = "<tr class='$class'>"; |
| 531 | + if ( $this->showButtonsFormatSignoffs ) { |
| 532 | + $checkbox = Html::input( 'wpSignoffs[]', $signoff->getID(), 'checkbox' ); |
| 533 | + $ret .= "<td>$checkbox</td>"; |
| 534 | + } |
| 535 | + $ret .= "<td>$user</td><td>$flag</td><td>$date</td></tr>"; |
| 536 | + return $ret; |
526 | 537 | } |
527 | 538 | |
528 | 539 | /** |