// Figure out which conditions can be done.
if ( in_array( 'recentchanges', $tables ) ) {
- $join_cond = 'rc_id';
+ $join_cond = 'ct_rc_id=rc_id';
} elseif ( in_array( 'logging', $tables ) ) {
- $join_cond = 'log_id';
+ $join_cond = 'ct_log_id=log_id';
} elseif ( in_array( 'revision', $tables ) ) {
- $join_cond = 'rev_id';
+ $join_cond = 'ct_rev_id=rev_id';
+ } elseif ( in_array( 'archive', $tables ) ) {
+ $join_cond = 'ct_rev_id=ar_rev_id';
} else {
throw new MWException( 'Unable to determine appropriate JOIN condition for tagging.' );
}
$fields['ts_tags'] = wfGetDB( DB_SLAVE )->buildGroupConcatField(
- ',', 'change_tag', 'ct_tag', "ct_$join_cond=$join_cond"
+ ',', 'change_tag', 'ct_tag', $join_cond
);
if ( $wgUseTagFilter && $filter_tag ) {
// Add an INNER JOIN on change_tag
$tables[] = 'change_tag';
- $join_conds['change_tag'] = array( 'INNER JOIN', "ct_$join_cond=$join_cond" );
+ $join_conds['change_tag'] = array( 'INNER JOIN', $join_cond );
$conds['ct_tag'] = $filter_tag;
}
}
$dbr = wfGetDB( DB_SLAVE );
+ $tables = array( 'archive' );
+
$fields = array(
'ar_minor_edit', 'ar_timestamp', 'ar_user', 'ar_user_text',
'ar_comment', 'ar_len', 'ar_deleted', 'ar_rev_id', 'ar_sha1',
$fields[] = 'ar_content_model';
}
- $res = $dbr->select( 'archive',
+ $conds = array( 'ar_namespace' => $this->title->getNamespace(),
+ 'ar_title' => $this->title->getDBkey() );
+
+ $options = array( 'ORDER BY' => 'ar_timestamp DESC' );
+
+ $join_conds = array();
+
+ ChangeTags::modifyDisplayQuery(
+ $tables,
$fields,
- array( 'ar_namespace' => $this->title->getNamespace(),
- 'ar_title' => $this->title->getDBkey() ),
+ $conds,
+ $join_conds,
+ $options
+ );
+
+ $res = $dbr->select( $tables,
+ $fields,
+ $conds,
__METHOD__,
- array( 'ORDER BY' => 'ar_timestamp DESC' ) );
+ $options,
+ $join_conds
+ );
return $dbr->resultObject( $res );
}
$rdel = " $rdel";
}
+ $minor = $rev->isMinor() ? ChangesList::flag( 'minor' ) : '';
+
+ $tags = wfGetDB( DB_SLAVE )->selectField(
+ 'tag_summary',
+ 'ts_tags',
+ array( 'ts_rev_id' => $rev->getId() ),
+ __METHOD__
+ );
+ $tagSummary = ChangeTags::formatSummaryRow( $tags, 'deleteddiff' );
+
return '<div id="mw-diff-' . $prefix . 'title1"><strong>' .
Linker::link(
$targetPage,
Linker::revUserTools( $rev ) . '<br />' .
'</div>' .
'<div id="mw-diff-' . $prefix . 'title3">' .
- Linker::revComment( $rev ) . $rdel . '<br />' .
+ $minor . Linker::revComment( $rev ) . $rdel . '<br />' .
+ '</div>' .
+ '<div id="mw-diff-' . $prefix . 'title5">' .
+ $tagSummary[0] . '<br />' .
'</div>';
}
// User links
$userLink = Linker::revUserTools( $rev );
+ // Minor edit
+ $minor = $rev->isMinor() ? ChangesList::flag( 'minor' ) : '';
+
// Revision text size
$size = $row->ar_len;
if ( !is_null( $size ) ) {
// Edit summary
$comment = Linker::revComment( $rev );
+ // Tags
+ $attribs = array();
+ list( $tagSummary, $classes ) = ChangeTags::formatSummaryRow( $row->ts_tags, 'deletedhistory' );
+ if ( $classes ) {
+ $attribs['class'] = implode( ' ', $classes );
+ }
+
// Revision delete links
$revdlink = Linker::getRevDeleteLink( $user, $rev, $this->mTargetObj );
- $revisionRow = $this->msg( 'undelete-revisionrow' )
- ->rawParams( $checkBox, $revdlink, $last, $pageLink, $userLink, $revTextSize, $comment )
+ $revisionRow = $this->msg( 'undelete-revision-row' )
+ ->rawParams( $checkBox, $revdlink, $last, $pageLink, $userLink, $minor, $revTextSize, $comment, $tagSummary )
->escaped();
- return "<li>$revisionRow</li>";
+ return Xml::tags( 'li', $attribs, $revisionRow ) . "\n";
}
private function formatFileRow( $row ) {
$1',
'undelete-show-file-confirm' => 'Are you sure you want to view the deleted revision of the file "<nowiki>$1</nowiki>" from $2 at $3?',
'undelete-show-file-submit' => 'Yes',
-'undelete-revisionrow' => '$1 $2 ($3) $4 . . $5 $6 $7', # only translate this message to other languages if you have to change it
+'undelete-revision-row' => '$1 $2 ($3) $4 . . $5 $6 $7 $8 $9', # only translate this message to other languages if you have to change it
# Namespace form on various pages
'namespace' => 'Namespace:',
* $3 - the time of the displayed revision
{{Identical|Are you sure you want to view the deleted revision of the file...}}',
'undelete-show-file-submit' => '{{Identical|Yes}}',
-'undelete-revisionrow' => "{{Optional}}
+'undelete-revision-row' => "{{Optional}}
A revision row in the undelete page. Parameters:
* $1 is a checkBox to indicate whether to restore this specific revision
* $2 is a link to the revision
* $3 is a link to the last revision of a page ({{msg-mw|last}})
* $4 is a link to the page
* $5 is a link to the revision's user
-* $6 is the revision size
-* $7 is the revision comment",
+* $6 is the revision's minor edit identifier
+* $7 is the revision size
+* $8 is the revision comment
+* $9 is the revision's tags",
# Namespace form on various pages
'namespace' => 'This message is located at [[Special:Contributions]].
'version-entrypoints-scriptpath',
'mergehistory-revisionrow',
'categoryviewer-pagedlinks',
- 'undelete-revisionrow',
+ 'undelete-revision-row',
'pageinfo-redirects-value',
'created', // @deprecated. Remove in MediaWiki 1.23.
'changed', // @deprecated. Remove in MediaWiki 1.23.
'undelete-error-long',
'undelete-show-file-confirm',
'undelete-show-file-submit',
- 'undelete-revisionrow',
+ 'undelete-revision-row',
),
'nsform' => array(
'namespace',