From: Rob Church Date: Thu, 4 Jan 2007 14:08:51 +0000 (+0000) Subject: (bug 8487) Don't show users action watch preferences that aren't applicable X-Git-Tag: 1.31.0-rc.0~54671 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=b19720f0a21732339ce161ca31b1255d1b0dd4aa;p=lhc%2Fweb%2Fwiklou.git (bug 8487) Don't show users action watch preferences that aren't applicable --- diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index ded82fbdbe..d910dfffb4 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -882,7 +882,19 @@ class PreferencesForm { $wgOut->addHtml( '

' ); $wgOut->addHtml( $this->getToggles( array( 'watchlisthideown', 'watchlisthidebots', 'watchlisthideminor' ) ) ); - $wgOut->addHtml( $this->getToggles( array( 'watchdefault', 'watchcreations', 'watchmoves', 'watchdeletion' ) ) ); + + if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 'createtalk' ) ) + $wgOut->addHtml( $this->getToggle( 'watchcreations' ) ); + foreach( array( 'edit' => 'watchdefault', 'move' => 'watchmoves', 'delete' => 'watchdeletion' ) as $action => $toggle ) { + if( $wgUser->isAllowed( $action ) ) + $wgOut->addHtml( $this->getToggle( $toggle ) ); + } + $this->mUsedToggles['watchcreations'] = true; + $this->mUsedToggles['watchdefault'] = true; + $this->mUsedToggles['watchmoves'] = true; + $this->mUsedToggles['watchdeletion'] = true; + + #$wgOut->addHtml( $this->getToggles( array( 'watchdefault', 'watchcreations', 'watchmoves', 'watchdeletion' ) ) ); $wgOut->addHtml( '' );