MediaWiki
1.40.4
ChangeTagsLogItem.php
Go to the documentation of this file.
1
<?php
22
use
MediaWiki\MediaWikiServices
;
23
use
MediaWiki\Revision\RevisionRecord
;
24
use
MediaWiki\Title\Title
;
25
32
class
ChangeTagsLogItem
extends
RevisionItemBase
{
33
public
function
getIdField
() {
34
return
'log_id'
;
35
}
36
37
public
function
getTimestampField
() {
38
return
'log_timestamp'
;
39
}
40
41
public
function
getAuthorIdField
() {
42
return
'log_user'
;
43
}
44
45
public
function
getAuthorNameField
() {
46
return
'log_user_text'
;
47
}
48
49
public
function
getAuthorActorField
() {
50
return
'log_actor'
;
51
}
52
53
public
function
canView
() {
54
return
LogEventsList::userCan(
55
$this->row, RevisionRecord::SUPPRESSED_ALL, $this->list->getAuthority()
56
);
57
}
58
59
public
function
canViewContent
() {
60
return
true
;
// none
61
}
62
66
public
function
getTags
() {
67
return
$this->row->ts_tags;
68
}
69
74
public
function
getHTML
() {
75
$date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
76
$this->row->log_timestamp, $this->list->getUser() ) );
77
$title
= Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
78
$formatter = LogFormatter::newFromRow( $this->row );
79
$formatter->setContext( $this->list->getContext() );
80
$formatter->setAudience( LogFormatter::FOR_THIS_USER );
81
82
// Log link for this page
83
$loglink = MediaWikiServices::getInstance()->getLinkRenderer()->makeLink(
84
SpecialPage::getTitleFor
(
'Log'
),
85
$this->list->msg(
'log'
)->text(),
86
[],
87
[
'page'
=>
$title
->getPrefixedText() ]
88
);
89
$loglink = $this->list->msg(
'parentheses'
)->rawParams( $loglink )->escaped();
90
// User links and action text
91
$action = $formatter->getActionText();
92
93
$comment = $this->list->getLanguage()->getDirMark() .
94
$formatter->getComment();
95
96
$content
=
"$loglink $date $action $comment"
;
97
$attribs = [];
98
$tags = $this->
getTags
();
99
if
( $tags ) {
100
[ $tagSummary, $classes ] =
ChangeTags::formatSummaryRow
(
101
$tags,
102
'edittags'
,
103
$this->list->getContext()
104
);
105
$content
.=
" $tagSummary"
;
106
$attribs[
'class'
] = implode(
' '
, $classes );
107
}
108
return
Xml::tags(
'li'
, $attribs,
$content
);
109
}
110
}
ChangeTagsLogItem
Item class for a logging table row with its associated change tags.
Definition
ChangeTagsLogItem.php:32
ChangeTagsLogItem\getHTML
getHTML()
Definition
ChangeTagsLogItem.php:74
ChangeTagsLogItem\getAuthorNameField
getAuthorNameField()
Get the DB field name storing user names.
Definition
ChangeTagsLogItem.php:45
ChangeTagsLogItem\getIdField
getIdField()
Get the DB field name associated with the ID list.
Definition
ChangeTagsLogItem.php:33
ChangeTagsLogItem\canViewContent
canViewContent()
Returns true if the current user can view the item text/file.
Definition
ChangeTagsLogItem.php:59
ChangeTagsLogItem\getAuthorIdField
getAuthorIdField()
Get the DB field name storing user ids.
Definition
ChangeTagsLogItem.php:41
ChangeTagsLogItem\getAuthorActorField
getAuthorActorField()
Get the DB field name storing actor ids.
Definition
ChangeTagsLogItem.php:49
ChangeTagsLogItem\getTimestampField
getTimestampField()
Get the DB field name storing timestamps.
Definition
ChangeTagsLogItem.php:37
ChangeTagsLogItem\canView
canView()
Returns true if the current user can view the item.
Definition
ChangeTagsLogItem.php:53
ChangeTagsLogItem\getTags
getTags()
Definition
ChangeTagsLogItem.php:66
ChangeTags\formatSummaryRow
static formatSummaryRow( $tags, $unused, MessageLocalizer $localizer=null)
Creates HTML for the given tags.
Definition
ChangeTags.php:198
MediaWiki\MediaWikiServices
Service locator for MediaWiki core services.
Definition
MediaWikiServices.php:223
MediaWiki\Revision\RevisionRecord
Page revision base class.
Definition
RevisionRecord.php:47
MediaWiki\Title\Title
Represents a title within MediaWiki.
Definition
Title.php:82
RevisionItemBase
Abstract base class for revision items.
Definition
RevisionItemBase.php:29
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
$content
$content
Definition
router.php:76
$title
$title
Definition
testCompression.php:39
includes
changetags
ChangeTagsLogItem.php
Generated on Thu Jun 27 2024 15:50:28 for MediaWiki by
1.10.0