r72492 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72491‎ | r72492 | r72493 >
Date:13:21, 6 September 2010
Author:werdna
Status:deferred
Tags:
Comment:
Re-work interception of LQT actions. Resolves bug 23716
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/Dispatch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/Dispatch.php
@@ -21,13 +21,11 @@
2222 return false;
2323 }
2424
25 - /**
26 - * Certain actions apply to the "header", which is stored in the actual talkpage
27 - * in the database. Drop everything and behave like a normal page if those
28 - * actions come up, to avoid hacking the various history, editing, etc. code.
29 - */
30 - $action = $request->getVal( 'action' );
31 - $header_actions = array( 'history', 'edit', 'submit', 'delete' );
 25+ global $mediaWiki;
 26+ $action = $mediaWiki->getVal('action');
 27+
 28+ // Actions handled by LQT.
 29+ $lqt_actions = array( 'view', 'protect', 'unprotect' );
3230
3331 $lqt_action = $request->getVal( 'lqt_method' );
3432 if ( $action == 'edit' && $request->getVal( 'section' ) == 'new' ) {
@@ -36,7 +34,8 @@
3735 $request->setVal( 'section', '' );
3836
3937 $viewname = 'TalkpageView';
40 - } elseif ( !$lqt_action && ( in_array( $action, $header_actions ) ||
 38+ } elseif ( !$lqt_action && (
 39+ ( !in_array( $action, $lqt_actions ) && $action) ||
4140 $request->getVal( 'diff', null ) !== null ) ) {
4241 // Pass through wrapper
4342 $viewname = 'TalkpageHeaderView';

Status & tagging log