From f0385c46308be6e680ba3a667a3f26f127732e83 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Tue, 18 Apr 2006 01:13:15 +0000 Subject: [PATCH] Fix up issues with being unable to show all (when the default was to hide both)...it works, but there's something I can't quite put my finger on there... --- includes/SpecialWatchlist.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index 5c89a33aae..5f5544b39c 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -38,9 +38,9 @@ function wfSpecialWatchlist( $par ) { } $defaults = array( - /* float */ 'days' => 3.0, /* or 0.5, watch further below */ - /* bool */ 'hideOwn' => false, - /* bool */ 'hideBots' => false, + /* float */ 'days' => floatval( $wgUser->getOption( 'watchlistdays' ) ), /* 3.0 or 0.5, watch further below */ + /* bool */ 'hideOwn' => $wgUser->getBoolOption( 'watchlisthideown' ), + /* bool */ 'hideBots' => $wgUser->getBoolOption( 'watchlisthidebots' ), 'namespace' => 'all', ); @@ -48,16 +48,14 @@ function wfSpecialWatchlist( $par ) { # Extract variables from the request, falling back to user preferences or # other default values if these don't exist - $prefs['days'] = floatval( $wgUser->getOption( 'watchlistdays' ) ); - $prefs['hideown'] = $wgUser->getBoolOption( 'watchlisthideown' ); - - # The hide bots thing is b0rk3d for now - # $prefs['bots'] = $wgUser->getBoolOption( 'watchlisthidebots' ); + $prefs['days' ] = floatval( $wgUser->getOption( 'watchlistdays' ) ); + $prefs['hideown' ] = $wgUser->getBoolOption( 'watchlisthideown' ); + $prefs['hidebots'] = $wgUser->getBoolOption( 'watchlisthidebots' ); # Get query variables $days = $wgRequest->getVal( 'days', $prefs['days'] ); $hideOwn = $wgRequest->getBool( 'hideOwn', $prefs['hideown'] ); - $hideBots = $wgRequest->getBool( 'hideBots' ); + $hideBots = $wgRequest->getBool( 'hideBots', $prefs['hidebots'] ); # Get namespace value, if supplied, and prepare a WHERE fragment $nameSpace = $wgRequest->getIntOrNull( 'namespace' ); @@ -316,7 +314,7 @@ function wfSpecialWatchlist( $par ) { $linkElements = array( 'hideOwn' => 'wlhideshowown', 'hideBots' => 'wlhideshowbots' ); foreach( $linkElements as $var => $msg ) { - $label = $$var == 0 ? wfMsgHtml( 'hide' ) : wfMsgHtml( 'show' ); + $label = $$var == 0 ? wfMsgHtml( 'hide' ) : wfMsgHtml( 'show' ); $linkBits = wfArrayToCGI( array( $var => 1 - $$var ), $nondefaults ); $link = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); $links[] = wfMsgHtml( $msg, $link ); -- 2.20.1