X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fchanges%2FChangesList.php;h=34d73d65053dfb5963159f5de4cc748cc31ac5e3;hp=0382d7360f7a1dc61a0108e3d59d21b9f4041c2a;hb=82bd6b026ef6ecb7f2fe15acaa40c608680dfff1;hpb=a389d94551f1ece9112c66bf8a53f66d3c15c0b2 diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index 0382d7360f..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 { @@ -161,6 +161,7 @@ class ChangesList extends ContextSource { */ private function preCacheMessages() { if ( !isset( $this->message ) ) { + $this->message = []; foreach ( [ 'cur', 'diff', 'hist', 'enhancedrc-history', 'last', 'blocklink', 'history', 'semicolon-separator', 'pipe-separator' ] as $msg @@ -454,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; + } } /** @@ -624,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(),