r24890 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24889‎ | r24890 | r24891 >
Date:00:17, 18 August 2007
Author:david
Status:old
Tags:
Comment:
fixed a few bugs with history
Modified paths:
  • /branches/liquidthreads/extensions/LqtExtension.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtExtension.php
@@ -991,10 +991,14 @@
992992 * @return string HTML output for the row
993993 */
994994 function historyLine( $row, $next, $counter = '', $notificationtimestamp = false, $latest = false, $firstInList = false ) {
 995+
 996+ $hthread = HistoricalThread::fromTextRepresentation($row->hthread_contents);
 997+ return $this->rowForThread($hthread);
 998+ }
 999+
 1000+ private function rowForThread($t) {
9951001 global $wgLang, $wgOut; // TODO global.
9961002
997 - $hthread = HistoricalThread::fromTextRepresentation($row->hthread_contents);
998 -
9991003 /* TODO: best not to refer to LqtView class directly. */
10001004 /* We don't use oldid because that has side-effects. */
10011005 $result = array();
@@ -1002,18 +1006,19 @@
10031007 Threads::CHANGE_EDITED_SUMMARY => "Summary changed:",
10041008 Threads::CHANGE_REPLY_CREATED => "New reply created:",
10051009 Threads::CHANGE_NEW_THREAD => "New thread created:");
1006 - $url = LqtView::permalinkUrlWithQuery( $this->thread, 'lqt_oldid=' . $row->hthread_revision );
 1010+ $url = LqtView::permalinkUrlWithQuery( $this->thread, 'lqt_oldid=' . $t->revisionNumber() );
10071011
1008 - $p = new Parser(); $sig = $wgOut->parse( $p->getUserSig( $hthread->changeUser() ), false );
 1012+ $p = new Parser(); $sig = $wgOut->parse( $p->getUserSig( $t->changeUser() ), false );
10091013
10101014 $result[] = "<tr>";
1011 - $result[] = "<td><a href=\"$url\">" . $wgLang->timeanddate($this->thread->timestamp()) . "</a></td>";
 1015+ $result[] = "<td><a href=\"$url\">" . $wgLang->timeanddate($t->timestamp()) . "</a></td>";
10121016 $result[] = "<td>" . $sig . "</td>";
1013 - $result[] = "<td>{$change_names[$row->hthread_change_type]}</td>";
1014 - $result[] = "<td>" . $hthread->changeComment() . "</td>";
 1017+ $result[] = "<td>{$change_names[$t->changeType()]}</td>";
 1018+ $result[] = "<td>" . $t->changeComment() . "</td>";
10151019 $result[] = "</tr>";
10161020 return implode('', $result);
10171021 }
 1022+
10181023 function getNotificationTimestamp() {
10191024 return "foo";
10201025 }
@@ -1025,11 +1030,16 @@
10261031 function getStartBody() {
10271032 $this->mLastRow = false;
10281033 $this->mCounter = 1;
1029 - return '<table>';
 1034+
 1035+ // Due to the screwy way we're doing history, the last revision we show,
 1036+ // that is, the current revision, is in the thread table, not the
 1037+ // historical_thread table. aurggghhh!
 1038+ // TODO paging.
 1039+ return '<table>' . $this->rowForThread($this->thread);
10301040 }
10311041
10321042 function getEndBody() {
1033 - return "</table>";
 1043+ return '</table>';
10341044 }
10351045 }
10361046

Status & tagging log