r51476 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51475‎ | r51476 | r51477 >
Date:20:46, 4 June 2009
Author:werdna
Status:deferred
Tags:
Comment:
LiquidThreads code quality and readability:
* Comments in miscellaneous places.
* Use == NS_LQT_THREAD + 1 instead of ->getSubjectPage->getNamespace() == NS_LQT_THREAD
Modified paths:
  • /trunk/extensions/LiquidThreads/LiquidThreads.php (modified) (history)
  • /trunk/extensions/LiquidThreads/LqtFunctions.php (modified) (history)
  • /trunk/extensions/LiquidThreads/classes/LqtDispatch.php (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/TalkpageHeaderView.php (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/ThreadProtectionFormView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/LqtFunctions.php
@@ -67,7 +67,7 @@
6868 return $html;
6969 }
7070
71 -function wfLqtBeforeWatchlistHook( &$conds, &$tables, &$join_conds, &$fields ) {
 71+function efLqtBeforeWatchlistHook( &$conds, &$tables, &$join_conds, &$fields ) {
7272 global $wgOut, $wgUser;
7373
7474 if ( !in_array( 'page', $tables ) ) {
Index: trunk/extensions/LiquidThreads/LiquidThreads.php
@@ -41,7 +41,7 @@
4242 $wgExtensionAliasesFiles['LiquidThreads'] = $dir . 'Lqt.alias.php';
4343
4444 // Hooks
45 -$wgHooks['SpecialWatchlistQuery'][] = 'wfLqtBeforeWatchlistHook';
 45+$wgHooks['SpecialWatchlistQuery'][] = 'efLqtBeforeWatchlistHook';
4646 $wgHooks['MediaWikiPerformAction'][] = 'LqtDispatch::tryPage';
4747 $wgHooks['SpecialMovepageAfterMove'][] = 'LqtDispatch::onPageMove';
4848 $wgHooks['LinkerMakeLinkObj'][] = 'LqtDispatch::makeLinkObj';
Index: trunk/extensions/LiquidThreads/classes/LqtDispatch.php
@@ -20,7 +20,7 @@
2121 // non-talk article and pass that to the view.
2222 $article = new Article( $title );
2323
24 - if ( $title->getSubjectPage()->getNamespace() == NS_LQT_THREAD ) {
 24+ if ( $title->getNamespace() == NS_LQT_THREAD + 1 /* talk page */ ) {
2525 // Threads don't have talk pages; redirect to the thread page.
2626 $output->redirect( $title->getSubjectPage()->getFullUrl() );
2727 }
@@ -34,8 +34,10 @@
3535 if ( $request->getVal( 'lqt_method', null ) === null &&
3636 ( in_array( $action, $header_actions ) ||
3737 $request->getVal( 'diff', null ) !== null ) ) {
 38+ // Pass through wrapper
3839 $viewname = self::$views['TalkpageHeaderView'];
3940 } else if ( $action == 'protect' || $action == 'unprotect' ) {
 41+ // Pass through wrapper
4042 $viewname = self::$views['ThreadProtectionFormView'];
4143 } else if ( $request->getVal( 'lqt_method' ) == 'talkpage_archive' ) {
4244 $viewname = self::$views['TalkpageArchiveView'];
Index: trunk/extensions/LiquidThreads/pages/TalkpageHeaderView.php
@@ -1,6 +1,7 @@
22 <?php
33
44 if ( !defined( 'MEDIAWIKI' ) ) die;
 5+// Pass-through wrapper with an extra note at the top
56
67 class TalkpageHeaderView extends LqtView {
78 function customizeTabs( $skintemplate, $content_actions ) {
Index: trunk/extensions/LiquidThreads/pages/ThreadProtectionFormView.php
@@ -2,6 +2,7 @@
33
44 if ( !defined( 'MEDIAWIKI' ) ) die;
55
 6+// Pass-through wrapper
67 class ThreadProtectionFormView {
78 function customizeTabs( $skintemplate, $content_actions ) {
89 unset( $content_actions['edit'] );

Status & tagging log