$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 );
}
$out->addHTML(
Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
Xml::fieldset( $this->msg( 'undelete-search-box' )->text() ) .
- Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) .
+ Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) .
Html::rawElement(
'label',
array( 'for' => 'prefix' ),
$out->addWikiMsg( 'undeletepagetext', $this->getLanguage()->formatNum( $result->numRows() ) );
- $undelete = $this->getTitle();
+ $undelete = $this->getPageTitle();
$out->addHTML( "<ul>\n" );
foreach ( $result as $row ) {
$title = Title::makeTitleSafe( $row->ar_namespace, $row->ar_title );
}
$link = Linker::linkKnown(
- $this->getTitle( $this->mTargetObj->getPrefixedDBkey() ),
+ $this->getPageTitle( $this->mTargetObj->getPrefixedDBkey() ),
htmlspecialchars( $this->mTargetObj->getPrefixedText() )
);
'style' => 'clear: both' ) ) .
Xml::openElement( 'form', array(
'method' => 'post',
- 'action' => $this->getTitle()->getLocalURL( array( 'action' => 'submit' ) ) ) ) .
+ 'action' => $this->getPageTitle()->getLocalURL( array( 'action' => 'submit' ) ) ) ) .
Xml::element( 'input', array(
'type' => 'hidden',
'name' => 'target',
$diffEngine = $currentRev->getContentHandler()->createDifferenceEngine( $diffContext );
$diffEngine->showDiffStyle();
- $this->getOutput()->addHTML( "<div>" .
- "<table style='width: 98%;' cellpadding='0' cellspacing='4' class='diff'>" .
- "<col class='diff-marker' />" .
- "<col class='diff-content' />" .
- "<col class='diff-marker' />" .
- "<col class='diff-content' />" .
- "<tr>" .
- "<td colspan='2' style='width: 50%; text-align: center' class='diff-otitle'>" .
- $this->diffHeader( $previousRev, 'o' ) .
- "</td>\n" .
- "<td colspan='2' style='width: 50%; text-align: center' class='diff-ntitle'>" .
- $this->diffHeader( $currentRev, 'n' ) .
- "</td>\n" .
- "</tr>" .
- $diffEngine->generateContentDiffBody(
- $previousRev->getContent( Revision::FOR_THIS_USER, $this->getUser() ),
- $currentRev->getContent( Revision::FOR_THIS_USER, $this->getUser() ) ) .
- "</table>" .
- "</div>\n"
+
+ $formattedDiff = $diffEngine->generateContentDiffBody(
+ $previousRev->getContent( Revision::FOR_THIS_USER, $this->getUser() ),
+ $currentRev->getContent( Revision::FOR_THIS_USER, $this->getUser() )
);
+
+ $formattedDiff = $diffEngine->addHeader(
+ $formattedDiff,
+ $this->diffHeader( $previousRev, 'o' ),
+ $this->diffHeader( $currentRev, 'n' )
+ );
+
+ $this->getOutput()->addHTML( "<div>$formattedDiff</div>\n" );
}
/**
$isDeleted = !( $rev->getId() && $rev->getTitle() );
if ( $isDeleted ) {
/// @todo FIXME: $rev->getTitle() is null for deleted revs...?
- $targetPage = $this->getTitle();
+ $targetPage = $this->getPageTitle();
$targetQuery = array(
'target' => $this->mTargetObj->getPrefixedText(),
'timestamp' => wfTimestamp( TS_MW, $rev->getTimestamp() )
$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' );
+
+ // FIXME This is reimplementing DifferenceEngine#getRevisionHeader
+ // and partially #showDiffPage, but worse
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>';
}
$out->addHTML(
Xml::openElement( 'form', array(
'method' => 'POST',
- 'action' => $this->getTitle()->getLocalURL( array(
+ 'action' => $this->getPageTitle()->getLocalURL( array(
'target' => $this->mTarget,
'file' => $key,
'token' => $user->getEditToken( $key ),
}
if ( $this->mAllowed ) {
- $action = $this->getTitle()->getLocalURL( array( 'action' => 'submit' ) );
+ $action = $this->getPageTitle()->getLocalURL( array( 'action' => 'submit' ) );
# Start the form here
$top = Xml::openElement(
'form',
// Build page & diff links...
$user = $this->getUser();
if ( $this->mCanView ) {
- $titleObj = $this->getTitle();
+ $titleObj = $this->getPageTitle();
# Last link
if ( !$rev->userCan( Revision::DELETED_TEXT, $this->getUser() ) ) {
$pageLink = htmlspecialchars( $this->getLanguage()->userTimeAndDate( $ts, $user ) );
// 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 ) {
if ( $this->mAllowed && $row->fa_storage_key ) {
$checkBox = Xml::check( 'fileid' . $row->fa_id );
$key = urlencode( $row->fa_storage_key );
- $pageLink = $this->getFileLink( $file, $this->getTitle(), $ts, $key );
+ $pageLink = $this->getFileLink( $file, $this->getPageTitle(), $ts, $key );
} else {
$checkBox = '';
$pageLink = $this->getLanguage()->userTimeAndDate( $ts, $user );