3 use MediaWiki\MediaWikiServices
;
5 class ContentModelLogFormatter
extends LogFormatter
{
6 protected function getMessageParameters() {
7 $lang = $this->context
->getLanguage();
8 $params = parent
::getMessageParameters();
9 $params[3] = ContentHandler
::getLocalizedName( $params[3], $lang );
10 $params[4] = ContentHandler
::getLocalizedName( $params[4], $lang );
14 public function getActionLinks() {
15 if ( $this->entry
->isDeleted( LogPage
::DELETED_ACTION
) // Action is hidden
16 ||
$this->entry
->getSubtype() !== 'change'
17 ||
!$this->context
->getUser()->isAllowed( 'editcontentmodel' )
22 $params = $this->extractParameters();
23 $revert = MediaWikiServices
::getInstance()->getLinkRenderer()->makeKnownLink(
24 SpecialPage
::getTitleFor( 'ChangeContentModel' ),
25 $this->msg( 'logentry-contentmodel-change-revertlink' )->text(),
28 'pagetitle' => $this->entry
->getTarget()->getPrefixedText(),
29 'model' => $params[3],
30 'reason' => $this->msg( 'logentry-contentmodel-change-revert' )->inContentLanguage()->text(),
34 return $this->msg( 'parentheses' )->rawParams( $revert )->escaped();