MediaWiki master
ChangeTagsRevisionItem.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\ChangeTags;
22
27
38 public function getTags() {
39 return $this->row->ts_tags;
40 }
41
46 public function getHTML() {
47 $difflink = $this->list->msg( 'parentheses' )
48 ->rawParams( $this->getDiffLink() )->escaped();
49 $revlink = $this->getRevisionLink();
50 $userlink = Linker::revUserLink( $this->getRevisionRecord() );
51 $comment = MediaWikiServices::getInstance()->getCommentFormatter()
52 ->formatRevision( $this->getRevisionRecord(), $this->list->getAuthority() );
53 if ( $this->isDeleted() ) {
54 $class = Linker::getRevisionDeletedClass( $this->getRevisionRecord() );
55 $revlink = "<span class=\"$class\">$revlink</span>";
56 }
57
58 $content = "$difflink $revlink $userlink $comment";
59 $attribs = [];
60 $tags = $this->getTags();
61 if ( $tags ) {
62 [ $tagSummary, $classes ] = ChangeTags::formatSummaryRow(
63 $tags,
64 'edittags',
65 $this->list->getContext()
66 );
67 $content .= " $tagSummary";
68 $attribs['class'] = $classes;
69 }
70 return Html::rawElement( 'li', $attribs, $content );
71 }
72}
73
75class_alias( ChangeTagsRevisionItem::class, 'ChangeTagsRevisionItem' );
Item class for a live revision table row with its associated change tags.
static formatSummaryRow( $tags, $unused, ?MessageLocalizer $localizer=null)
Creates HTML for the given tags.
This class is a collection of static functions that serve two purposes:
Definition Html.php:57
Some internal bits split of from Skin.php.
Definition Linker.php:61
Service locator for MediaWiki core services.
static getInstance()
Returns the global default instance of the top level service locator.
Item class for a live revision table row.
getDiffLink()
Get the HTML link to the diff.
getRevisionRecord()
Get the RevisionRecord for the item.
getRevisionLink()
Get the HTML link to the revision text.