From c27ffd34fa64081a000347a0bcb036b7d7821848 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sat, 4 Jul 2009 01:46:41 +0000 Subject: [PATCH] (bug 19468) $wgEnotifWatchlist disabled, but option available on preferences --- RELEASE-NOTES | 1 + includes/Preferences.php | 52 +++++++++++++++++++++++----------------- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5400a608bb..dc66781bb9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -227,6 +227,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 19509) Uploading to a file named '0' previously treated it as null input and attempted to upload with the source name. Now warns about not having an extension (since 0.ext is perfectly valid) +* (bug 19468) Enotif preferences are now only displayed when they are turned on == API changes in 1.16 == diff --git a/includes/Preferences.php b/includes/Preferences.php index a7bd902585..e8e7e146fa 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -355,28 +355,36 @@ class Preferences { 'disabled' => $disableEmailPrefs, ); } - - $defaultPreferences['enotifwatchlistpages'] = - array( - 'type' => 'toggle', - 'section' => 'personal/email', - 'label-message' => 'tog-enotifwatchlistpages', - 'disabled' => $disableEmailPrefs, - ); - $defaultPreferences['enotifusertalkpages'] = - array( - 'type' => 'toggle', - 'section' => 'personal/email', - 'label-message' => 'tog-enotifusertalkpages', - 'disabled' => $disableEmailPrefs, - ); - $defaultPreferences['enotifminoredits'] = - array( - 'type' => 'toggle', - 'section' => 'personal/email', - 'label-message' => 'tog-enotifminoredits', - 'disabled' => $disableEmailPrefs, - ); + + global $wgEnotifWatchlist; + if ( $wgEnotifWatchlist ) { + $defaultPreferences['enotifwatchlistpages'] = + array( + 'type' => 'toggle', + 'section' => 'personal/email', + 'label-message' => 'tog-enotifwatchlistpages', + 'disabled' => $disableEmailPrefs, + ); + } + global $wgEnotifUserTalk; + if( $wgEnotifUserTalk ) { + $defaultPreferences['enotifusertalkpages'] = + array( + 'type' => 'toggle', + 'section' => 'personal/email', + 'label-message' => 'tog-enotifusertalkpages', + 'disabled' => $disableEmailPrefs, + ); + } + if( $wgEnotifUserTalk || $wgEnotifWatchlist ) { + $defaultPreferences['enotifminoredits'] = + array( + 'type' => 'toggle', + 'section' => 'personal/email', + 'label-message' => 'tog-enotifminoredits', + 'disabled' => $disableEmailPrefs, + ); + } $defaultPreferences['enotifrevealaddr'] = array( 'type' => 'toggle', -- 2.20.1