Index: branches/liquidthreads/extensions/LqtPages.php |
— | — | @@ -433,6 +433,8 @@ |
434 | 434 | $this->showSummarizeForm($this->thread); |
435 | 435 | |
436 | 436 | $this->showThread($this->thread); |
| 437 | + |
| 438 | + return false; |
437 | 439 | } |
438 | 440 | } |
439 | 441 | |
— | — | @@ -597,6 +599,8 @@ |
598 | 600 | $this->showHistoryListing($this->thread); |
599 | 601 | |
600 | 602 | $this->showThread($this->thread); |
| 603 | + |
| 604 | + return false; |
601 | 605 | } |
602 | 606 | } |
603 | 607 | |
— | — | @@ -636,6 +640,7 @@ |
637 | 641 | function show() { |
638 | 642 | $this->showHistoryInfo(); |
639 | 643 | parent::show(); |
| 644 | + return false; |
640 | 645 | } |
641 | 646 | } |
642 | 647 | |
Index: branches/liquidthreads/extensions/LqtBaseView.php |
— | — | @@ -32,6 +32,7 @@ |
33 | 33 | 'TalkpageView' => 'TalkpageView', |
34 | 34 | 'ThreadHistoryListingView' => 'ThreadHistoryListingView', |
35 | 35 | 'ThreadHistoricalRevisionView' => 'ThreadHistoricalRevisionView', |
| 36 | + 'ThreadDiffView' => 'ThreadDiffView', |
36 | 37 | 'ThreadPermalinkView' => 'ThreadPermalinkView' |
37 | 38 | ); |
38 | 39 | |
— | — | @@ -64,18 +65,19 @@ |
65 | 66 | } |
66 | 67 | |
67 | 68 | static function threadPermalinkMain(&$output, &$article, &$title, &$user, &$request) { |
68 | | - /* breaking the lqt_method paradigm to make the history tab work. |
69 | | - (just changing the href doesn't make the highlighting correct.) */ |
| 69 | + /* breaking the lqt_method paradigm to make the history tab work. |
| 70 | + (just changing the href doesn't make the highlighting correct.) */ |
70 | 71 | if( $request->getVal('action') == 'history' ) { |
71 | 72 | $viewname = self::$views['ThreadHistoryListingView']; |
| 73 | + } else if ( $request->getVal('lqt_method') == 'diff' ) { |
| 74 | + $viewname = self::$views['ThreadDiffView']; |
72 | 75 | } else if ( $request->getVal('lqt_oldid', null) !== null ) { |
73 | 76 | $viewname = self::$views['ThreadHistoricalRevisionView']; |
74 | 77 | } else { |
75 | 78 | $viewname = self::$views['ThreadPermalinkView']; |
76 | 79 | } |
77 | 80 | $view = new $viewname( $output, $article, $title, $user, $request ); |
78 | | - $view->show(); |
79 | | - return false; |
| 81 | + return $view->show(); |
80 | 82 | } |
81 | 83 | |
82 | 84 | /** |
— | — | @@ -129,6 +131,29 @@ |
130 | 132 | } |
131 | 133 | } |
132 | 134 | |
| 135 | +class ThreadDiffView { |
| 136 | + function customizeTabs( $skintemplate, $content_actions ) { |
| 137 | + unset($content_actions['edit']); |
| 138 | + unset($content_actions['addsection']); |
| 139 | + unset($content_actions['history']); |
| 140 | + unset($content_actions['watch']); |
| 141 | + unset($content_actions['move']); |
| 142 | + |
| 143 | + $content_actions['talk']['class'] = false; |
| 144 | + $content_actions['header'] = array( 'class'=>'selected', |
| 145 | + 'text'=>'header', |
| 146 | + 'href'=>''); |
| 147 | + |
| 148 | + return true; |
| 149 | + } |
| 150 | + |
| 151 | + function show() { |
| 152 | + global $wgHooks; |
| 153 | + $wgHooks['SkinTemplateTabs'][] = array($this, 'customizeTabs'); |
| 154 | + return true; |
| 155 | + } |
| 156 | +} |
| 157 | + |
133 | 158 | $wgHooks['MediaWikiPerformAction'][] = array('LqtDispatch::tryPage'); |
134 | 159 | $wgHooks['SpecialMovepageAfterMove'][] = array('LqtDispatch::onPageMove'); |
135 | 160 | |
— | — | @@ -232,7 +257,7 @@ |
233 | 258 | $curr_rev = Revision::newFromTitle( $changed_thread->root()->getTitle(), $curr_rev_id ); |
234 | 259 | $prev_rev = $curr_rev->getPrevious(); |
235 | 260 | $oldid = $prev_rev ? $prev_rev->getId() : ""; |
236 | | - return self::permalinkUrlWithQuery( $changed_thread, array('diff'=>$curr_rev_id, 'oldid'=>$oldid) ); |
| 261 | + return self::permalinkUrlWithQuery( $changed_thread, array('lqt_method'=>'diff', 'diff'=>$curr_rev_id, 'oldid'=>$oldid) ); |
237 | 262 | } |
238 | 263 | |
239 | 264 | static function talkpageUrl( $title, $method = null, $operand = null, $includeFragment = true ) { |