MediaWiki 1.40.4
ChangeTagsLogItem.php
Go to the documentation of this file.
1<?php
25
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(
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}
Item class for a logging table row with its associated change tags.
getAuthorNameField()
Get the DB field name storing user names.
getIdField()
Get the DB field name associated with the ID list.
canViewContent()
Returns true if the current user can view the item text/file.
getAuthorIdField()
Get the DB field name storing user ids.
getAuthorActorField()
Get the DB field name storing actor ids.
getTimestampField()
Get the DB field name storing timestamps.
canView()
Returns true if the current user can view the item.
static formatSummaryRow( $tags, $unused, MessageLocalizer $localizer=null)
Creates HTML for the given tags.
Service locator for MediaWiki core services.
Page revision base class.
Represents a title within MediaWiki.
Definition Title.php:82
Abstract base class for revision items.
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,...
$content
Definition router.php:76