(bug 19468) $wgEnotifWatchlist disabled, but option available on preferences
authorChad Horohoe <demon@users.mediawiki.org>
Sat, 4 Jul 2009 01:46:41 +0000 (01:46 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sat, 4 Jul 2009 01:46:41 +0000 (01:46 +0000)
RELEASE-NOTES
includes/Preferences.php

index 5400a60..dc66781 100644 (file)
@@ -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 ==
 
index a7bd902..e8e7e14 100644 (file)
@@ -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',