Merge "Move mCounter property from AbuseFilterViewExamine to AbuseFilterExaminePager"

This commit is contained in:
jenkins-bot 2020-10-31 16:27:12 +00:00 committed by Gerrit Code Review
commit bec7c44d12
2 changed files with 11 additions and 13 deletions

View file

@ -6,10 +6,6 @@ use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\RevisionRecord;
class AbuseFilterViewExamine extends AbuseFilterView {
/**
* @var int Line number of the row, see RecentChange::$counter
*/
public $mCounter;
/**
* @var string The user whose entries we're examinating
*/
@ -98,16 +94,13 @@ class AbuseFilterViewExamine extends AbuseFilterView {
*/
public function showResults() {
$changesList = new AbuseFilterChangesList( $this->getSkin(), $this->mTestFilter );
$output = $changesList->beginRecentChangesList();
$this->mCounter = 1;
$pager = new AbuseFilterExaminePager( $this, $changesList );
$output .= $pager->getNavigationBar() .
$pager->getBody() .
$pager->getNavigationBar();
$output .= $changesList->endRecentChangesList();
$output = $changesList->beginRecentChangesList()
. $pager->getNavigationBar()
. $pager->getBody()
. $pager->getNavigationBar()
. $changesList->endRecentChangesList();
$this->getOutput()->addHTML( $output );
}

View file

@ -9,6 +9,10 @@ class AbuseFilterExaminePager extends ReverseChronologicalPager {
* @var AbuseFilterViewExamine The associated view
*/
public $mPage;
/**
* @var int Line number of the row, see RecentChange::$counter
*/
public $rcCounter;
/**
* @param AbuseFilterViewExamine $page
@ -18,6 +22,7 @@ class AbuseFilterExaminePager extends ReverseChronologicalPager {
parent::__construct();
$this->mChangesList = $changesList;
$this->mPage = $page;
$this->rcCounter = 1;
}
/**
@ -62,7 +67,7 @@ class AbuseFilterExaminePager extends ReverseChronologicalPager {
*/
public function formatRow( $row ) {
$rc = RecentChange::newFromRow( $row );
$rc->counter = $this->mPage->mCounter++;
$rc->counter = $this->rcCounter++;
return $this->mChangesList->recentChangesLine( $rc, false );
}