X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/includes/changetags/ChangeTagsLogItem.php diff --git a/includes/changetags/ChangeTagsLogItem.php b/includes/changetags/ChangeTagsLogItem.php new file mode 100644 index 00000000..032310b9 --- /dev/null +++ b/includes/changetags/ChangeTagsLogItem.php @@ -0,0 +1,106 @@ +row, Revision::SUPPRESSED_ALL, $this->list->getUser() ); + } + + public function canViewContent() { + return true; // none + } + + /** + * @return string Comma-separated list of tags + */ + public function getTags() { + return $this->row->ts_tags; + } + + /** + * @return string A HTML
  • element representing this revision, showing + * change tags and everything + */ + public function getHTML() { + $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate( + $this->row->log_timestamp, $this->list->getUser() ) ); + $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title ); + $formatter = LogFormatter::newFromRow( $this->row ); + $formatter->setContext( $this->list->getContext() ); + $formatter->setAudience( LogFormatter::FOR_THIS_USER ); + + // Log link for this page + $loglink = MediaWikiServices::getInstance()->getLinkRenderer()->makeLink( + SpecialPage::getTitleFor( 'Log' ), + $this->list->msg( 'log' )->text(), + [], + [ 'page' => $title->getPrefixedText() ] + ); + $loglink = $this->list->msg( 'parentheses' )->rawParams( $loglink )->escaped(); + // User links and action text + $action = $formatter->getActionText(); + // Comment + $comment = $this->list->getLanguage()->getDirMark() . + $formatter->getComment(); + + if ( LogEventsList::isDeleted( $this->row, LogPage::DELETED_COMMENT ) ) { + $comment = '' . $comment . ''; + } + + $content = "$loglink $date $action $comment"; + $attribs = []; + $tags = $this->getTags(); + if ( $tags ) { + list( $tagSummary, $classes ) = ChangeTags::formatSummaryRow( + $tags, + 'edittags', + $this->list->getContext() + ); + $content .= " $tagSummary"; + $attribs['class'] = implode( ' ', $classes ); + } + return Xml::tags( 'li', $attribs, $content ); + } +}