testFilter = $testFilter;
}
/**
* @param string &$s
* @param RecentChange &$rc
* @param string[] &$classes
*/
public function insertExtra( &$s, &$rc, &$classes ) {
if ( (int)$rc->getAttribute( 'rc_deleted' ) !== 0 ) {
$s .= ' ' . $this->msg( 'abusefilter-log-hidden-implicit' )->parse();
if ( !$this->userCan( $rc, Revision::SUPPRESSED_ALL ) ) {
return;
}
}
$examineParams = [];
if ( $this->testFilter ) {
$examineParams['testfilter'] = $this->testFilter;
}
$title = SpecialPage::getTitleFor( 'AbuseFilter', 'examine/' . $rc->mAttribs['rc_id'] );
$examineLink = $this->linkRenderer->makeLink(
$title,
new HtmlArmor( $this->msg( 'abusefilter-changeslist-examine' )->parse() ),
[],
$examineParams
);
$s .= ' '.$this->msg( 'parentheses' )->rawParams( $examineLink )->escaped();
# If we have a match..
if ( isset( $rc->filterResult ) ) {
$class = $rc->filterResult ?
'mw-abusefilter-changeslist-match' :
'mw-abusefilter-changeslist-nomatch';
$classes[] = $class;
}
}
/**
* Insert links to user page, user talk page and eventually a blocking link.
* Like the parent, but don't hide details if user can see them.
*
* @param string &$s HTML to update
* @param RecentChange &$rc
*/
public function insertUserRelatedLinks( &$s, &$rc ) {
$links = $this->getLanguage()->getDirMark() . Linker::userLink( $rc->mAttribs['rc_user'],
$rc->mAttribs['rc_user_text'] ) .
Linker::userToolLinks( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] );
if ( $this->isDeleted( $rc, Revision::DELETED_USER ) ) {
if ( $this->userCan( $rc, Revision::DELETED_USER ) ) {
$s .= ' ' . $links . '';
} else {
$s .= ' ' .
$this->msg( 'rev-deleted-user' )->escaped() . '';
}
} else {
$s .= $links;
}
}
/**
* Insert a formatted comment. Like the parent, but don't hide details if user can see them.
* @param RecentChange $rc
* @return string
*/
public function insertComment( $rc ) {
if ( $this->isDeleted( $rc, Revision::DELETED_COMMENT ) ) {
if ( $this->userCan( $rc, Revision::DELETED_COMMENT ) ) {
return ' ' .
Linker::commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle() ) . '';
} else {
return ' ' .
$this->msg( 'rev-deleted-comment' )->escaped() . '';
}
} else {
return Linker::commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle() );
}
}
/**
* Insert a formatted action. The same as parent, but with a different audience in LogFormatter
*
* @param RecentChange $rc
* @return string
*/
public function insertLogEntry( $rc ) {
$formatter = LogFormatter::newFromRow( $rc->mAttribs );
$formatter->setContext( $this->getContext() );
$formatter->setAudience( LogFormatter::FOR_THIS_USER );
$formatter->setShowUserToolLinks( true );
$mark = $this->getLanguage()->getDirMark();
return $formatter->getActionText() . " $mark" . $formatter->getComment();
}
/**
* @param string &$s
* @param RecentChange &$rc
*/
public function insertRollback( &$s, &$rc ) {
// Kill rollback links.
}
}