MediaWiki REL1_30
ContentModelLogFormatter.php
Go to the documentation of this file.
1<?php
2
4
6 protected function getMessageParameters() {
7 $lang = $this->context->getLanguage();
8 $params = parent::getMessageParameters();
11 return $params;
12 }
13
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 '';
20 }
21
22 $params = $this->extractParameters();
23 $revert = MediaWikiServices::getInstance()->getLinkRenderer()->makeKnownLink(
24 SpecialPage::getTitleFor( 'ChangeContentModel' ),
25 $this->msg( 'logentry-contentmodel-change-revertlink' )->text(),
26 [],
27 [
28 'pagetitle' => $this->entry->getTarget()->getPrefixedText(),
29 'model' => $params[3],
30 'reason' => $this->msg( 'logentry-contentmodel-change-revert' )->inContentLanguage()->text(),
31 ]
32 );
33
34 return $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
35 }
36}
static getLocalizedName( $name, Language $lang=null)
Returns the localized name for a given content model.
getActionLinks()
Returns extra links that comes after the action text, like "revert", etc.
getMessageParameters()
Formats parameters intented for action message from array of all parameters.
Implements the default log formatting.
msg( $key)
Shortcut for wfMessage which honors local context.
extractParameters()
Extracts the optional extra parameters for use in action messages.
const DELETED_ACTION
Definition LogPage.php:32
MediaWikiServices is the service locator for the application scope of MediaWiki.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
Definition design.txt:18
returning false will NOT prevent logging a wrapping ErrorException instead of letting the login form give the generic error message that the account does not exist For when the account has been renamed or deleted or an array to pass a message key and parameters create2 Corresponds to logging log_action database field and which is displayed in the UI & $revert
Definition hooks.txt:2176
$params
if(!isset( $args[0])) $lang