MediaWiki
REL1_35
ContentModelLogFormatter.php
Go to the documentation of this file.
1
<?php
2
3
use
MediaWiki\MediaWikiServices
;
4
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;
12
}
13
14
public
function
getActionLinks
() {
15
if
( $this->entry->isDeleted(
LogPage::DELETED_ACTION
)
// Action is hidden
16
|| $this->entry->getSubtype() !==
'change'
17
|| !MediaWikiServices::getInstance()
18
->getPermissionManager()
19
->userHasRight( $this->context->getUser(),
'editcontentmodel'
)
20
) {
21
return
''
;
22
}
23
24
$params = $this->
extractParameters
();
25
$revert = $this->
getLinkRenderer
()->makeKnownLink(
26
SpecialPage::getTitleFor
(
'ChangeContentModel'
),
27
$this->
msg
(
'logentry-contentmodel-change-revertlink'
)->text(),
28
[],
29
[
30
'pagetitle'
=> $this->entry->getTarget()->getPrefixedText(),
31
'model'
=> $params[3],
32
'reason'
=> $this->msg(
'logentry-contentmodel-change-revert'
)->inContentLanguage()->text(),
33
]
34
);
35
36
return
$this->
msg
(
'parentheses'
)->rawParams( $revert )->escaped();
37
}
38
}
ContentModelLogFormatter
Definition
ContentModelLogFormatter.php:5
ContentModelLogFormatter\getActionLinks
getActionLinks()
Returns extra links that comes after the action text, like "revert", etc.
Definition
ContentModelLogFormatter.php:14
ContentModelLogFormatter\getMessageParameters
getMessageParameters()
Formats parameters intented for action message from array of all parameters.
Definition
ContentModelLogFormatter.php:6
LogFormatter
Implements the default log formatting.
Definition
LogFormatter.php:40
LogFormatter\getLinkRenderer
getLinkRenderer()
Definition
LogFormatter.php:143
LogFormatter\msg
msg( $key,... $params)
Shortcut for wfMessage which honors local context.
Definition
LogFormatter.php:775
LogFormatter\extractParameters
extractParameters()
Extracts the optional extra parameters for use in action messages.
Definition
LogFormatter.php:525
LogPage\DELETED_ACTION
const DELETED_ACTION
Definition
LogPage.php:38
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition
MediaWikiServices.php:152
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:92
$lang
if(!isset( $args[0])) $lang
Definition
testCompression.php:37
includes
logging
ContentModelLogFormatter.php
Generated on Sat Apr 6 2024 00:07:29 for MediaWiki by
1.9.8