Uncommitted stuff still in my working copy:
authorAndrew Garrett <werdna@users.mediawiki.org>
Tue, 28 Apr 2009 23:49:44 +0000 (23:49 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Tue, 28 Apr 2009 23:49:44 +0000 (23:49 +0000)
* Logic for disabling email fields for unauthenticated addresses.
* Remove float styling for fieldsets in preferences form, ugly and annoying.

includes/Preferences.php
skins/monobook/main.css

index 5d5362e..f18918f 100644 (file)
@@ -286,6 +286,8 @@ class Preferences {
                                
                global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication;
                
+               $disableEmailPrefs = false;
+               
                if ( $wgEmailAuthentication ) {
                        if ( $user->getEmail() ) {
                                if( $user->getEmailAuthenticationTimestamp() ) {
@@ -306,6 +308,7 @@ class Preferences {
                                                        wfMsg( 'emailconfirmlink' ) ) . '<br />';
                                }
                        } else {
+                               $disableEmailPrefs = true;
                                $emailauthenticated = wfMsg( 'noemailprefs' );
                        }
                        
@@ -328,12 +331,14 @@ class Preferences {
                                                        'invert' => true,
                                                        'section' => 'personal/email',
                                                        'label-message' => 'allowemail',
+                                                       'disabled' => $disableEmailPrefs,
                                                );
                                $defaultPreferences['ccmeonemails'] =
                                                array(
                                                        'type' => 'toggle',
                                                        'section' => 'personal/email',
                                                        'label-message' => 'tog-ccmeonemails',
+                                                       'disabled' => $disableEmailPrefs,
                                                );
                        }
                        
@@ -342,24 +347,28 @@ class Preferences {
                                                '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,
                                        );
                        $defaultPreferences['enotifrevealaddr'] =
                                        array(
                                                'type' => 'toggle',
                                                'section' => 'personal/email',
-                                               'label-message' => 'tog-enotifrevealaddr'
+                                               'label-message' => 'tog-enotifrevealaddr',
+                                               'disabled' => $disableEmailPrefs,
                                        );
                }
        }
index e653c47..9ad5843 100644 (file)
@@ -966,6 +966,13 @@ li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print {
        height: 1%;
 }
 
+.mw-htmlform-submit {
+       font-weight: bold;
+       padding-left: .3em;
+       padding-right: .3em;
+       margin-right: 2em;
+}
+
 /* js pref toc */
 #preftoc {
        margin: 0;
@@ -1027,11 +1034,7 @@ li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print {
        padding: 0;
        margin: 0;
 }
-.prefsection fieldset {
-       border: 1px solid #aaa;
-       float: left;
-       margin-right: 2em;
-}
+
 .prefsection legend {
        font-weight: bold;   
 }
@@ -1046,12 +1049,6 @@ td.htmlform-tip {
        padding: .2em 2em;
        color: #666;
 }
-.mw-htmlform-submit {
-       font-weight: bold;
-       padding-left: .3em;
-       padding-right: .3em;
-       margin-right: 2em;
-}
 
 .preferences-login {
        clear: both;