X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fchanges%2FChangesList.php;h=34d73d65053dfb5963159f5de4cc748cc31ac5e3;hp=a48e1910033f6059596747fc934b635a75492a15;hb=203f7aba8c4d3279cd9de7cb479f08b80fb1800a;hpb=00ca43d824e11b1a45a2b08b433eb8e927524261 diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index a48e191003..34d73d6505 100644 --- a/includes/changes/ChangesList.php +++ b/includes/changes/ChangesList.php @@ -23,7 +23,7 @@ */ use MediaWiki\Linker\LinkRenderer; use MediaWiki\MediaWikiServices; -use MediaWiki\Storage\RevisionRecord; +use MediaWiki\Revision\RevisionRecord; use Wikimedia\Rdbms\IResultWrapper; class ChangesList extends ContextSource { @@ -455,13 +455,21 @@ class ChangesList extends ContextSource { * @param string &$s HTML to update * @param Title $title * @param string $logtype + * @param bool $useParentheses (optional) Wrap log entry in parentheses where needed */ - public function insertLog( &$s, $title, $logtype ) { + public function insertLog( &$s, $title, $logtype, $useParentheses = true ) { $page = new LogPage( $logtype ); $logname = $page->getName()->setContext( $this->getContext() )->text(); - $s .= Html::rawElement( 'span', [ - 'class' => 'mw-changeslist-links' - ], $this->linkRenderer->makeKnownLink( $title, $logname ) ); + $link = $this->linkRenderer->makeKnownLink( $title, $logname, [ + 'class' => $useParentheses ? '' : 'mw-changeslist-links' + ] ); + if ( $useParentheses ) { + $s .= $this->msg( 'parentheses' )->rawParams( + $link + )->escaped(); + } else { + $s .= $link; + } } /** @@ -625,7 +633,7 @@ class ChangesList extends ContextSource { */ public function insertComment( $rc ) { if ( $this->isDeleted( $rc, RevisionRecord::DELETED_COMMENT ) ) { - return ' ' . + return ' ' . $this->msg( 'rev-deleted-comment' )->escaped() . ''; } else { return Linker::commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle(),