Add url param 'extended' to Special:Watchlist
authorumherirrender <umherirrender_de.wp@web.de>
Tue, 12 Feb 2013 19:40:33 +0000 (20:40 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 18 Feb 2013 07:48:59 +0000 (07:48 +0000)
This new url param allows overridding of the user option
'extendwatchlist' in the same way than, for example, 'enhanced' for
'usenewrc'.
This is helpful to provide a extended enhanced watchlist per url.
Without extendwatchlist a enhanced watchlist is not useful (no page
groups possible)

Also fixed the default for param namespace

Change-Id: I115544005a621ee01a0ed0970a13099af92f42e7

includes/specials/SpecialWatchlist.php

index 1983542..39bf14c 100644 (file)
@@ -108,7 +108,8 @@ class SpecialWatchlist extends SpecialPage {
                /* bool  */ 'hideLiu'   => (int)$user->getBoolOption( 'watchlisthideliu' ),
                /* bool  */ 'hidePatrolled' => (int)$user->getBoolOption( 'watchlisthidepatrolled' ),
                /* bool  */ 'hideOwn'   => (int)$user->getBoolOption( 'watchlisthideown' ),
-               /* ?     */ 'namespace' => 'all',
+               /* bool  */ 'extended'   => (int)$user->getBoolOption( 'extendwatchlist' ),
+               /* ?     */ 'namespace' => '', //means all
                /* ?     */ 'invert'    => false,
                /* bool  */ 'associated' => false,
                );
@@ -127,6 +128,7 @@ class SpecialWatchlist extends SpecialPage {
                $prefs['hideliu'] = $user->getBoolOption( 'watchlisthideliu' );
                $prefs['hideown'] = $user->getBoolOption( 'watchlisthideown' );
                $prefs['hidepatrolled'] = $user->getBoolOption( 'watchlisthidepatrolled' );
+               $prefs['extended'] = $user->getBoolOption( 'extendwatchlist' );
 
                # Get query variables
                $values = array();
@@ -137,6 +139,7 @@ class SpecialWatchlist extends SpecialPage {
                $values['hideLiu'] = (int)$request->getBool( 'hideLiu', $prefs['hideliu'] );
                $values['hideOwn'] = (int)$request->getBool( 'hideOwn', $prefs['hideown'] );
                $values['hidePatrolled'] = (int)$request->getBool( 'hidePatrolled', $prefs['hidepatrolled'] );
+               $values['extended'] = (int)$request->getBool( 'extended', $prefs['extended'] );
                foreach( $this->customFilters as $key => $params ) {
                        $values[$key] = (int)$request->getBool( $key );
                }
@@ -232,7 +235,7 @@ class SpecialWatchlist extends SpecialPage {
                }
 
                # Toggle watchlist content (all recent edits or just the latest)
-               if( $user->getOption( 'extendwatchlist' ) ) {
+               if( $values['extended'] ) {
                        $limitWatchlist = intval( $user->getOption( 'wllimit' ) );
                        $usePage = false;
                } else {