From b19720f0a21732339ce161ca31b1255d1b0dd4aa Mon Sep 17 00:00:00 2001 From: Rob Church Date: Thu, 4 Jan 2007 14:08:51 +0000 Subject: [PATCH] (bug 8487) Don't show users action watch preferences that aren't applicable --- includes/SpecialPreferences.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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( '' ); -- 2.20.1