r104250 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104249‎ | r104250 | r104251 >
Date:17:41, 25 November 2011
Author:aaron
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.18wmf1/includes/ChangesList.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/includes/ChangesList.php
@@ -513,6 +513,18 @@
514514 public function insertExtra( &$s, &$rc, &$classes ) {
515515 ## Empty, used for subclassers to add anything special.
516516 }
 517+
 518+ protected function showAsUnpatrolled( RecentChange $rc ) {
 519+ $unpatrolled = false;
 520+ if ( !$rc->mAttribs['rc_patrolled'] ) {
 521+ if ( $this->getUser()->useRCPatrol() ) {
 522+ $unpatrolled = true;
 523+ } elseif ( $this->getUser()->useNPPatrol() && $rc->mAttribs['rc_new'] ) {
 524+ $unpatrolled = true;
 525+ }
 526+ }
 527+ return $unpatrolled;
 528+ }
517529 }
518530
519531
@@ -528,8 +540,9 @@
529541 public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
530542 global $wgRCShowChangedSize;
531543 wfProfileIn( __METHOD__ );
 544+
532545 # Should patrol-related stuff be shown?
533 - $unpatrolled = $this->getUser()->useRCPatrol() && !$rc->mAttribs['rc_patrolled'];
 546+ $unpatrolled = $this->showAsUnpatrolled( $rc );
534547
535548 $dateheader = ''; // $s now contains only <li>...</li>, for hooks' convenience.
536549 $this->insertDateHeader( $dateheader, $rc->mAttribs['rc_timestamp'] );
@@ -661,11 +674,7 @@
662675 }
663676
664677 # Should patrol-related stuff be shown?
665 - if( $this->getUser()->useRCPatrol() ) {
666 - $rc->unpatrolled = !$rc->mAttribs['rc_patrolled'];
667 - } else {
668 - $rc->unpatrolled = false;
669 - }
 678+ $rc->unpatrolled = $this->showAsUnpatrolled( $rc );
670679
671680 $showdifflinks = true;
672681 # Make article link

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102559Removed code that set 'patrolmarks' rights; useless as $wgFlaggedRevsRCPatrol...aaron19:28, 9 November 2011
r103641Made ChangesList generate page links with rcid=x for new pages when $wgUseNPP...aaron05:37, 19 November 2011

Status & tagging log