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