From: Aaron Schulz Date: Sat, 19 Nov 2011 05:37:24 +0000 (+0000) Subject: Made ChangesList generate page links with rcid=x for new pages when $wgUseNPPatrol... X-Git-Tag: 1.31.0-rc.0~26430 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=33a86e678a16ae39f85e7745f598493818429302;p=lhc%2Fweb%2Fwiklou.git Made ChangesList generate page links with rcid=x for new pages when $wgUseNPPatrol is on (not just $wgUseRCPatrol) --- diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 0462a2b303..d8eab4350a 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -483,6 +483,18 @@ class ChangesList extends ContextSource { public function insertExtra( &$s, &$rc, &$classes ) { ## Empty, used for subclassers to add anything special. } + + protected function showAsUnpatrolled( RecentChange $rc ) { + $unpatrolled = false; + if ( !$rc->mAttribs['rc_patrolled'] ) { + if ( $this->getUser()->useRCPatrol() ) { + $unpatrolled = true; + } elseif ( $this->getUser()->useNPPatrol() && $rc->mAttribs['rc_new'] ) { + $unpatrolled = true; + } + } + return $unpatrolled; + } } @@ -498,8 +510,9 @@ class OldChangesList extends ChangesList { public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) { global $wgRCShowChangedSize; wfProfileIn( __METHOD__ ); + # Should patrol-related stuff be shown? - $unpatrolled = $this->getUser()->useRCPatrol() && !$rc->mAttribs['rc_patrolled']; + $unpatrolled = $this->showAsUnpatrolled( $rc ); $dateheader = ''; // $s now contains only
  • ...
  • , for hooks' convenience. $this->insertDateHeader( $dateheader, $rc->mAttribs['rc_timestamp'] ); @@ -633,11 +646,7 @@ class EnhancedChangesList extends ChangesList { } # Should patrol-related stuff be shown? - if( $this->getUser()->useRCPatrol() ) { - $rc->unpatrolled = !$rc->mAttribs['rc_patrolled']; - } else { - $rc->unpatrolled = false; - } + $rc->unpatrolled = $this->showAsUnpatrolled( $rc ); $showdifflinks = true; # Make article link