r82142 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82141‎ | r82142 | r82143 >
Date:21:00, 14 February 2011
Author:reedy
Status:ok
Tags:
Comment:
Followup r82135, only show checkbox if needed
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRevisionView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php
@@ -3,6 +3,8 @@
44 // Special:Code/MediaWiki/40696
55 class CodeRevisionView extends CodeView {
66
 7+ protected $showButtonsFormatReference = false;
 8+
79 /**
810 * @param string|CodeRepository $repo
911 * @param string|CodeRevision $rev
@@ -483,6 +485,7 @@
484486 }
485487
486488 protected function formatReferences( $showButtons ) {
 489+ $this->showButtonsFormatReference = $showButtons;
487490 $refs = implode( "\n",
488491 array_map( array( $this, 'formatReferenceInline' ), $this->mRev->getReferences() )
489492 );
@@ -584,8 +587,14 @@
585588 $revLink = $this->skin->link( $title, $this->mRev->getIdString( $rev ) );
586589 $summary = $this->messageFragment( $row->cr_message );
587590 $author = $this->authorLink( $row->cr_author );
588 - $checkbox = Html::input( 'wpReferences[]', $rev, 'checkbox' );
589 - return "<tr class='$css'><td>$checkbox</td><td>$revLink</td><td>$summary</td><td>$author</td><td>$date</td></tr>";
 591+
 592+ $ret = "<tr class='$css'>";
 593+ if ( $this->showButtonsFormatReference ) {
 594+ $checkbox = Html::input( 'wpReferences[]', $rev, 'checkbox' );
 595+ $ret .= "<td>$checkbox</td>";
 596+ }
 597+ $ret .= "<td>$revLink</td><td>$summary</td><td>$author</td><td>$date</td></tr>";
 598+ return $ret;
590599 }
591600
592601 protected function commentLink( $commentId ) {

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