r23971 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23970‎ | r23971 | r23972 >
Date:19:17, 10 July 2007
Author:brion
Status:old
Tags:
Comment:
Pretty up a couple bits to use the Revision object rather than raw row values.
Should fix timestamp issues on postgres, plus it's prettier ;)
Modified paths:
  • /trunk/extensions/DeletedContributions/DeletedContributions_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DeletedContributions/DeletedContributions_body.php
@@ -116,29 +116,28 @@
117117 ) );
118118
119119 $page = Title::makeTitle( $row->ar_namespace, $row->ar_title );
120 - $timestamp = $row->ar_timestamp;
121120
122 - $undelete =& SpecialPage::getTitleFor( 'Undelete' );
 121+ $undelete = SpecialPage::getTitleFor( 'Undelete' );
123122
124123 $logs = SpecialPage::getTitleFor( 'Log' );
125124 $dellog = $sk->makeKnownLinkObj( $logs, $this->messages['deletionlog'], 'type=delete&page=' . urlencode( $page->getPrefixedText() ) );
126125
127126 $reviewlink = $sk->makeKnownLinkObj( $undelete, $this->messages['undeletebtn'], 'target=' . $page->getPrefixedUrl() );
128127
129 - $link = $sk->makeKnownLinkObj( $undelete, htmlspecialchars( $page->getPrefixedText() ), 'target=' . $page->getPrefixedUrl() . '&timestamp=' . $timestamp);
 128+ $link = $sk->makeKnownLinkObj( $undelete, htmlspecialchars( $page->getPrefixedText() ), 'target=' . $page->getPrefixedUrl() . '&timestamp=' . $rev->getTimestamp());
130129
131130 $comment = $sk->revComment( $rev );
132 - $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->ar_timestamp ), true );
 131+ $d = $wgLang->timeanddate( $rev->getTimestamp(), true );
133132
134133 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
135134 $d = '<span class="history-deleted">' . $d . '</span>';
136135 } else {
137 - $link = $sk->makeKnownLinkObj( $undelete, $d, 'target=' . $page->getPrefixedUrl() . '&timestamp=' . $timestamp);
 136+ $link = $sk->makeKnownLinkObj( $undelete, $d, 'target=' . $page->getPrefixedUrl() . '&timestamp=' . $rev->getTimestamp());
138137 }
139138
140139 $pagelink = $sk->makeLinkObj( $page );
141140
142 - if( $row->ar_minor_edit ) {
 141+ if( $rev->isMinor() ) {
143142 $mflag = '<span class="minor">' . $this->messages['minoreditletter'] . '</span> ';
144143 } else {
145144 $mflag = '';

Status & tagging log