MediaWiki
REL1_39
ContentModelLogFormatter.php
Go to the documentation of this file.
1
<?php
2
3
class
ContentModelLogFormatter
extends
LogFormatter
{
4
protected
function
getMessageParameters
() {
5
$lang
= $this->context->getLanguage();
6
$params = parent::getMessageParameters();
7
$params[3] = ContentHandler::getLocalizedName( $params[3],
$lang
);
8
$params[4] = ContentHandler::getLocalizedName( $params[4],
$lang
);
9
return
$params;
10
}
11
12
public
function
getActionLinks
() {
13
if
( $this->entry->isDeleted(
LogPage::DELETED_ACTION
)
// Action is hidden
14
|| $this->entry->getSubtype() !==
'change'
15
|| !$this->context->getAuthority()->isAllowed(
'editcontentmodel'
)
16
) {
17
return
''
;
18
}
19
20
$params = $this->
extractParameters
();
21
$revert = $this->
getLinkRenderer
()->makeKnownLink(
22
SpecialPage::getTitleFor
(
'ChangeContentModel'
),
23
$this->
msg
(
'logentry-contentmodel-change-revertlink'
)->text(),
24
[],
25
[
26
'pagetitle'
=> $this->entry->getTarget()->getPrefixedText(),
27
'model'
=> $params[3],
28
'reason'
=> $this->msg(
'logentry-contentmodel-change-revert'
)->inContentLanguage()->text(),
29
]
30
);
31
32
return
$this->
msg
(
'parentheses'
)->rawParams( $revert )->escaped();
33
}
34
}
ContentModelLogFormatter
Definition
ContentModelLogFormatter.php:3
ContentModelLogFormatter\getActionLinks
getActionLinks()
Returns extra links that comes after the action text, like "revert", etc.
Definition
ContentModelLogFormatter.php:12
ContentModelLogFormatter\getMessageParameters
getMessageParameters()
Formats parameters intended for action message from array of all parameters.
Definition
ContentModelLogFormatter.php:4
LogFormatter
Implements the default log formatting.
Definition
LogFormatter.php:44
LogFormatter\getLinkRenderer
getLinkRenderer()
Definition
LogFormatter.php:148
LogFormatter\msg
msg( $key,... $params)
Shortcut for wfMessage which honors local context.
Definition
LogFormatter.php:780
LogFormatter\extractParameters
extractParameters()
Extracts the optional extra parameters for use in action messages.
Definition
LogFormatter.php:529
LogPage\DELETED_ACTION
const DELETED_ACTION
Definition
LogPage.php:40
SpecialPage\getTitleFor
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,...
Definition
SpecialPage.php:132
$lang
if(!isset( $args[0])) $lang
Definition
testCompression.php:37
includes
logging
ContentModelLogFormatter.php
Generated on Mon Dec 23 2024 06:23:54 for MediaWiki by
1.10.0