MediaWiki  master
ChangeTagsRevisionItem.php
Go to the documentation of this file.
1 <?php
24 
33  public function getTags() {
34  return $this->row->ts_tags;
35  }
36 
41  public function getHTML() {
42  $difflink = $this->list->msg( 'parentheses' )
43  ->rawParams( $this->getDiffLink() )->escaped();
44  $revlink = $this->getRevisionLink();
45  $userlink = Linker::revUserLink( $this->getRevisionRecord() );
46  $comment = MediaWikiServices::getInstance()->getCommentFormatter()
47  ->formatRevision( $this->getRevisionRecord(), $this->list->getAuthority() );
48  if ( $this->isDeleted() ) {
49  $class = Linker::getRevisionDeletedClass( $this->getRevisionRecord() );
50  $revlink = "<span class=\"$class\">$revlink</span>";
51  }
52 
53  $content = "$difflink $revlink $userlink $comment";
54  $attribs = [];
55  $tags = $this->getTags();
56  if ( $tags ) {
57  [ $tagSummary, $classes ] = ChangeTags::formatSummaryRow(
58  $tags,
59  'edittags',
60  $this->list->getContext()
61  );
62  $content .= " $tagSummary";
63  $attribs['class'] = implode( ' ', $classes );
64  }
65  return Xml::tags( 'li', $attribs, $content );
66  }
67 }
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.
Definition: ChangeTags.php:147
Some internal bits split of from Skin.php.
Definition: Linker.php:65
Service locator for MediaWiki core services.
Item class for a live revision table row.
getRevisionLink()
Get the HTML link to the revision text.
getDiffLink()
Get the HTML link to the diff.
getRevisionRecord()
Get the RevisionRecord for the item.
static tags( $element, $attribs, $contents)
Same as Xml::element(), but does not escape contents.
Definition: Xml.php:141
$content
Definition: router.php:76