r82144 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82143‎ | r82144 | r82145 >
Date:21:06, 14 February 2011
Author:reedy
Status:ok
Tags:
Comment:
Similar to bug 27405 / r82135

Do the same for followup, don't show checkbox column if not allowed to sign off
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRevisionView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php
@@ -3,7 +3,7 @@
44 // Special:Code/MediaWiki/40696
55 class CodeRevisionView extends CodeView {
66
7 - protected $showButtonsFormatReference = false;
 7+ protected $showButtonsFormatReference = false, $showButtonsFormatSignoffs = false;
88
99 /**
1010 * @param string|CodeRepository $repo
@@ -450,10 +450,15 @@
451451 * @return string HTML
452452 */
453453 protected function formatSignoffs( $showButtons ) {
 454+ $this->showButtonsFormatSignoffs = $showButtons;
454455 $signoffs = implode( "\n",
455456 array_map( array( $this, 'formatSignoffInline' ), $this->mRev->getSignoffs() )
456457 );
457 - $header = '<th></th>';
 458+
 459+ $header = '';
 460+ if ( $showButtons ) {
 461+ $header = '<th></th>';
 462+ }
458463 $header .= '<th>' . wfMsgHtml( 'code-signoff-field-user' ) . '</th>';
459464 $header .= '<th>' . wfMsgHtml( 'code-signoff-field-flag' ). '</th>';
460465 $header .= '<th>' . wfMsgHtml( 'code-signoff-field-date' ). '</th>';
@@ -509,7 +514,6 @@
510515 */
511516 protected function formatSignoffInline( $signoff ) {
512517 global $wgLang;
513 - $checkbox = Html::input( 'wpSignoffs[]', $signoff->getID(), 'checkbox' );
514518 $user = $this->skin->userLink( $signoff->user, $signoff->userText );
515519 $flag = htmlspecialchars( $signoff->flag );
516520 $signoffDate = $wgLang->timeanddate( $signoff->timestamp, true );
@@ -521,7 +525,14 @@
522526 } else {
523527 $date = htmlspecialchars( $signoffDate );
524528 }
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;
526537 }
527538
528539 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82135* (bug 27405) Special:Code should hide checkboxes when the user can't use themreedy20:20, 14 February 2011

Status & tagging log