MediaWiki master
ContentModelLogFormatter.php
Go to the documentation of this file.
1<?php
2
5
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 );
12 return $params;
13 }
14
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' )
19 ) {
20 return '';
21 }
22
23 $params = $this->extractParameters();
24 $revert = $this->getLinkRenderer()->makeKnownLink(
25 SpecialPage::getTitleFor( 'ChangeContentModel' ),
26 $this->msg( 'logentry-contentmodel-change-revertlink' )->text(),
27 [],
28 [
29 'pagetitle' => $this->entry->getTarget()->getPrefixedText(),
30 'model' => $params[3],
31 'reason' => $this->msg( 'logentry-contentmodel-change-revert' )->inContentLanguage()->text(),
32 ]
33 );
34
35 return $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
36 }
37}
array $params
The job parameters.
getActionLinks()
Returns extra links that comes after the action text, like "revert", etc.
getMessageParameters()
Formats parameters intended for action message from array of all parameters.
Implements the default log formatting.
msg( $key,... $params)
Shortcut for wfMessage which honors local context.
extractParameters()
Extracts the optional extra parameters for use in action messages.
A content handler knows how do deal with a specific type of content on a wiki page.
Parent class for all special pages.