*/
protected $rc_cache;
+ /**
+ * @var TemplateParser
+ */
+ protected $templateParser;
+
/**
* @param IContextSource|Skin $obj
+ * @param array $filterGroups Array of ChangesListFilterGroup objects (currently optional)
* @throws MWException
*/
- public function __construct( $obj ) {
+ public function __construct( $obj, array $filterGroups = [] ) {
if ( $obj instanceof Skin ) {
// @todo: deprecate constructing with Skin
$context = $obj->getContext();
$context = $obj;
}
- parent::__construct( $context );
+ parent::__construct( $context, $filterGroups );
// message is set by the parent ChangesList class
$this->cacheEntryFactory = new RCCacheEntryFactory(
$this->message,
$this->linkRenderer
);
+ $this->templateParser = new TemplateParser();
}
/**
&& $block[0]->mAttribs['rc_timestamp'] >= $block[0]->watched
) {
$tableClasses[] = 'mw-changeslist-line-watched';
- $tableClasses = array_merge( $tableClasses, $this->getHTMLClassesForFilters( $block[0] ) );
} else {
$tableClasses[] = 'mw-changeslist-line-not-watched';
}
$this->rcCacheIndex++;
- $templateParser = new TemplateParser();
- return $templateParser->processTemplate(
+ return $this->templateParser->processTemplate(
'EnhancedChangesListGroup',
$templateParams
);
if ( $rcObj->watched
&& $rcObj->mAttribs['rc_timestamp'] >= $rcObj->watched
) {
- $classes[] = [ 'mw-enhanced-watched' ];
+ $classes[] = 'mw-enhanced-watched';
}
$classes = array_merge( $classes, $this->getHTMLClassesForFilters( $rcObj ) );
$links['total-changes'] = $this->linkRenderer->makeKnownLink(
$block0->getTitle(),
new HtmlArmor( $nchanges[$n] ),
- [],
+ [ 'class' => 'mw-changeslist-groupdiff' ],
$queryParams + [
'diff' => $currentRevision,
'oldid' => $last->mAttribs['rc_last_oldid'],
$links['total-changes-since-last'] = $this->linkRenderer->makeKnownLink(
$block0->getTitle(),
new HtmlArmor( $sinceLastVisitMsg[$sinceLast] ),
- [],
+ [ 'class' => 'mw-changeslist-groupdiff' ],
$queryParams + [
'diff' => $currentRevision,
'oldid' => $unvisitedOldid,
$links['history'] = $this->linkRenderer->makeKnownLink(
$block0->getTitle(),
new HtmlArmor( $this->message['enhancedrc-history'] ),
- [],
+ [ 'class' => 'mw-changeslist-history' ],
$params
);
}
if ( $rc->getAttribute( 'rc_type' ) == RC_CATEGORIZE ) {
// For categorizations we must swap the category title with the page title!
$pageTitle = Title::newFromID( $rc->getAttribute( 'rc_cur_id' ) );
+ if ( !$pageTitle ) {
+ // The page has been deleted, but the RC entry
+ // deletion job has not run yet. Just skip.
+ return '';
+ }
}
$retVal = ' ' . $this->msg( 'parentheses' )
. $this->linkRenderer->makeKnownLink(
$pageTitle,
new HtmlArmor( $this->message['hist'] ),
- [],
+ [ 'class' => 'mw-changeslist-history' ],
$query
) )->escaped();
return $retVal;