r88893 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88892‎ | r88893 | r88894 >
Date:15:05, 26 May 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Hold into account if email notifications are enabled when showing user prefereneces
Modified paths:
  • /trunk/extensions/SemanticWatchlist/SemanticWatchlist.hooks.php (modified) (history)
  • /trunk/extensions/SemanticWatchlist/SemanticWatchlist.settings.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticWatchlist/SemanticWatchlist.settings.php
@@ -33,7 +33,7 @@
3434 $wgGroupPermissions['bot' ]['semanticwatchgroups'] = false;
3535 $wgGroupPermissions['sysop' ]['semanticwatchgroups'] = true;
3636
37 -# Enable email notification by default or not?
 37+# Enable email notification or not?
3838 $egSWLEnableEmailNotify = true;
3939
4040 # Send an email for every change (as opossed to a "something changed email" for the first $egSWLMaxMails changes)?
@@ -42,4 +42,5 @@
4343 # The maximum amount of generic emails to send about changes untill the user actually checks his semantic watchlist.
4444 $egSWLMaxMails = 1;
4545
 46+# The default value for the user preference to send email notifications.
4647 $wgDefaultUserOptions['swl_email'] = false;
Index: trunk/extensions/SemanticWatchlist/SemanticWatchlist.hooks.php
@@ -108,12 +108,15 @@
109109 public static function onGetPreferences( User $user, array &$preferences ) {
110110 $groups = SWLGroups::getAll();
111111
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+ }
118121
119122 foreach ( $groups as /* SWLGroup */ $group ) {
120123 if ( count( $group->getProperties() ) == 0 ) {

Status & tagging log