Index: trunk/extensions/SemanticWatchlist/SemanticWatchlist.settings.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | $wgGroupPermissions['bot' ]['semanticwatchgroups'] = false; |
35 | 35 | $wgGroupPermissions['sysop' ]['semanticwatchgroups'] = true; |
36 | 36 | |
37 | | -# Enable email notification by default or not? |
| 37 | +# Enable email notification or not? |
38 | 38 | $egSWLEnableEmailNotify = true; |
39 | 39 | |
40 | 40 | # Send an email for every change (as opossed to a "something changed email" for the first $egSWLMaxMails changes)? |
— | — | @@ -42,4 +42,5 @@ |
43 | 43 | # The maximum amount of generic emails to send about changes untill the user actually checks his semantic watchlist. |
44 | 44 | $egSWLMaxMails = 1; |
45 | 45 | |
| 46 | +# The default value for the user preference to send email notifications. |
46 | 47 | $wgDefaultUserOptions['swl_email'] = false; |
Index: trunk/extensions/SemanticWatchlist/SemanticWatchlist.hooks.php |
— | — | @@ -108,12 +108,15 @@ |
109 | 109 | public static function onGetPreferences( User $user, array &$preferences ) { |
110 | 110 | $groups = SWLGroups::getAll(); |
111 | 111 | |
112 | | - $preferences['swl_email'] = array( |
113 | | - 'type' => 'toggle', |
114 | | - 'label-message' => 'swl-prefs-emailnofity', |
115 | | - 'section' => 'swl/swlnotification', |
116 | | - 'default' => $GLOBALS['egSWLEnableEmailNotify'] |
117 | | - ); |
| 112 | + // Only show the email notification preference when email notifications are enabled. |
| 113 | + if ( $GLOBALS['egSWLEnableEmailNotify'] ) { |
| 114 | + $preferences['swl_email'] = array( |
| 115 | + 'type' => 'toggle', |
| 116 | + 'label-message' => 'swl-prefs-emailnofity', |
| 117 | + 'section' => 'swl/swlnotification', |
| 118 | + 'default' => $GLOBALS['egSWLEnableEmailNotify'] |
| 119 | + ); |
| 120 | + } |
118 | 121 | |
119 | 122 | foreach ( $groups as /* SWLGroup */ $group ) { |
120 | 123 | if ( count( $group->getProperties() ) == 0 ) { |