}
}
+ /**
+ * @return string A HTML <li> element representing this revision, showing
+ * change tags and everything
+ */
public function getHTML() {
$difflink = $this->list->msg( 'parentheses' )
->rawParams( $this->getDiffLink() )->escaped();
if ( $this->isDeleted() ) {
$revlink = "<span class=\"history-deleted\">$revlink</span>";
}
+ $content = "$difflink $revlink $userlink $comment";
+ $attribs = array();
+ $tags = $this->getTags();
+ if ( $tags ) {
+ list( $tagSummary, $classes ) = ChangeTags::formatSummaryRow( $tags, 'revisiondelete' );
+ $content .= " $tagSummary";
+ $attribs['class'] = implode( ' ', $classes );
+ }
+ return Xml::tags( 'li', $attribs, $content );
+ }
- return "<li>$difflink $revlink $userlink $comment</li>";
+ /**
+ * @return string Comma-separated list of tags
+ */
+ public function getTags() {
+ return $this->row->ts_tags;
}
public function getApiData( ApiResult $result ) {
*/
public function doQuery( $db ) {
$ids = array_map( 'intval', $this->ids );
- $live = $db->select(
- array( 'revision', 'page', 'user' ),
- array_merge( Revision::selectFields(), Revision::selectUserFields() ),
- array(
+ $queryInfo = array(
+ 'tables' => array( 'revision', 'user' ),
+ 'fields' => array_merge( Revision::selectFields(), Revision::selectUserFields() ),
+ 'conds' => array(
'rev_page' => $this->title->getArticleID(),
'rev_id' => $ids,
),
- __METHOD__,
- array( 'ORDER BY' => 'rev_id DESC' ),
- array(
+ 'options' => array( 'ORDER BY' => 'rev_id DESC' ),
+ 'join_conds' => array(
'page' => Revision::pageJoinCond(),
- 'user' => Revision::userJoinCond() )
+ 'user' => Revision::userJoinCond(),
+ ),
+ );
+ ChangeTags::modifyDisplayQuery(
+ $queryInfo['tables'],
+ $queryInfo['fields'],
+ $queryInfo['conds'],
+ $queryInfo['join_conds'],
+ $queryInfo['options'],
+ ''
);
+ $live = $db->select(
+ $queryInfo['tables'],
+ $queryInfo['fields'],
+ $queryInfo['conds'],
+ __METHOD__,
+ $queryInfo['options'],
+ $queryInfo['join_conds']
+ );
if ( $live->numRows() >= count( $ids ) ) {
// All requested revisions are live, keeps things simple!
return $live;