Added release notes for 'ContentHandler::runLegacyHooks' removal
[mediawiki.git] / includes / logging / ContentModelLogFormatter.php
blob861ea3021bb3bfaf720933a4ab30ddda305adf75
1 <?php
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 );
11 return $params;
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' )
18 ) {
19 return '';
22 $params = $this->extractParameters();
23 $revert = MediaWikiServices::getInstance()->getLinkRenderer()->makeKnownLink(
24 SpecialPage::getTitleFor( 'ChangeContentModel' ),
25 $this->msg( 'logentry-contentmodel-change-revertlink' )->text(),
26 [],
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();