*/
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\MediaWikiServices;
-use MediaWiki\Storage\RevisionRecord;
+use MediaWiki\Revision\RevisionRecord;
use Wikimedia\Rdbms\IResultWrapper;
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
* @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;
+ }
}
/**