r25304 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25303‎ | r25304 | r25305 >
Date:07:28, 30 August 2007
Author:david
Status:old
Tags:
Comment:
And now even diffs work. However, the editing links from the diff screen do not work. Possible solution to making more things work: Thread:Blah&action=edit to edit the root-level post Thread:Blah, and make lqt_method=edit be an optional or special feature for editing or appending replies.
Modified paths:
  • /branches/liquidthreads/extensions/LqtBaseView.php (modified) (history)
  • /branches/liquidthreads/extensions/LqtPages.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtPages.php
@@ -433,6 +433,8 @@
434434 $this->showSummarizeForm($this->thread);
435435
436436 $this->showThread($this->thread);
 437+
 438+ return false;
437439 }
438440 }
439441
@@ -597,6 +599,8 @@
598600 $this->showHistoryListing($this->thread);
599601
600602 $this->showThread($this->thread);
 603+
 604+ return false;
601605 }
602606 }
603607
@@ -636,6 +640,7 @@
637641 function show() {
638642 $this->showHistoryInfo();
639643 parent::show();
 644+ return false;
640645 }
641646 }
642647
Index: branches/liquidthreads/extensions/LqtBaseView.php
@@ -32,6 +32,7 @@
3333 'TalkpageView' => 'TalkpageView',
3434 'ThreadHistoryListingView' => 'ThreadHistoryListingView',
3535 'ThreadHistoricalRevisionView' => 'ThreadHistoricalRevisionView',
 36+ 'ThreadDiffView' => 'ThreadDiffView',
3637 'ThreadPermalinkView' => 'ThreadPermalinkView'
3738 );
3839
@@ -64,18 +65,19 @@
6566 }
6667
6768 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.) */
7071 if( $request->getVal('action') == 'history' ) {
7172 $viewname = self::$views['ThreadHistoryListingView'];
 73+ } else if ( $request->getVal('lqt_method') == 'diff' ) {
 74+ $viewname = self::$views['ThreadDiffView'];
7275 } else if ( $request->getVal('lqt_oldid', null) !== null ) {
7376 $viewname = self::$views['ThreadHistoricalRevisionView'];
7477 } else {
7578 $viewname = self::$views['ThreadPermalinkView'];
7679 }
7780 $view = new $viewname( $output, $article, $title, $user, $request );
78 - $view->show();
79 - return false;
 81+ return $view->show();
8082 }
8183
8284 /**
@@ -129,6 +131,29 @@
130132 }
131133 }
132134
 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+
133158 $wgHooks['MediaWikiPerformAction'][] = array('LqtDispatch::tryPage');
134159 $wgHooks['SpecialMovepageAfterMove'][] = array('LqtDispatch::onPageMove');
135160
@@ -232,7 +257,7 @@
233258 $curr_rev = Revision::newFromTitle( $changed_thread->root()->getTitle(), $curr_rev_id );
234259 $prev_rev = $curr_rev->getPrevious();
235260 $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) );
237262 }
238263
239264 static function talkpageUrl( $title, $method = null, $operand = null, $includeFragment = true ) {

Status & tagging log