Index: branches/liquidthreads/extensions/LqtExtension.php |
— | — | @@ -991,10 +991,14 @@ |
992 | 992 | * @return string HTML output for the row |
993 | 993 | */ |
994 | 994 | 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) { |
995 | 1001 | global $wgLang, $wgOut; // TODO global. |
996 | 1002 | |
997 | | - $hthread = HistoricalThread::fromTextRepresentation($row->hthread_contents); |
998 | | - |
999 | 1003 | /* TODO: best not to refer to LqtView class directly. */ |
1000 | 1004 | /* We don't use oldid because that has side-effects. */ |
1001 | 1005 | $result = array(); |
— | — | @@ -1002,18 +1006,19 @@ |
1003 | 1007 | Threads::CHANGE_EDITED_SUMMARY => "Summary changed:", |
1004 | 1008 | Threads::CHANGE_REPLY_CREATED => "New reply created:", |
1005 | 1009 | 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() ); |
1007 | 1011 | |
1008 | | - $p = new Parser(); $sig = $wgOut->parse( $p->getUserSig( $hthread->changeUser() ), false ); |
| 1012 | + $p = new Parser(); $sig = $wgOut->parse( $p->getUserSig( $t->changeUser() ), false ); |
1009 | 1013 | |
1010 | 1014 | $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>"; |
1012 | 1016 | $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>"; |
1015 | 1019 | $result[] = "</tr>"; |
1016 | 1020 | return implode('', $result); |
1017 | 1021 | } |
| 1022 | + |
1018 | 1023 | function getNotificationTimestamp() { |
1019 | 1024 | return "foo"; |
1020 | 1025 | } |
— | — | @@ -1025,11 +1030,16 @@ |
1026 | 1031 | function getStartBody() { |
1027 | 1032 | $this->mLastRow = false; |
1028 | 1033 | $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); |
1030 | 1040 | } |
1031 | 1041 | |
1032 | 1042 | function getEndBody() { |
1033 | | - return "</table>"; |
| 1043 | + return '</table>'; |
1034 | 1044 | } |
1035 | 1045 | } |
1036 | 1046 | |