* (bug 13982) Disable ccmeonemails preference when user-to-user mails disabled
[lhc/web/wiklou.git] / includes / SpecialPreferences.php
index b750475..c9ab9a7 100644 (file)
@@ -737,10 +737,13 @@ class PreferencesForm {
 
                        $moreEmail = '';
                        if ($wgEnableUserEmail) {
+                               // fixme -- the "allowemail" pseudotoggle is a hacked-together
+                               // inversion for the "disableemail" preference.
                                $emf = wfMsg( 'allowemail' );
                                $disabled = $disableEmailPrefs ? ' disabled="disabled"' : '';
                                $moreEmail =
-                               "<input type='checkbox' $emfc $disabled value='1' name='wpEmailFlag' id='wpEmailFlag' /> <label for='wpEmailFlag'>$emf</label>";
+                                       "<input type='checkbox' $emfc $disabled value='1' name='wpEmailFlag' id='wpEmailFlag' /> <label for='wpEmailFlag'>$emf</label>" .
+                                       $this->getToggle( 'ccmeonemails', '', $disableEmailPrefs );
                        }
 
 
@@ -752,8 +755,7 @@ class PreferencesForm {
                                        $enotifwatchlistpages.
                                        $enotifusertalkpages.
                                        $enotifminoredits.
-                                       $moreEmail.
-                                       $this->getToggle( 'ccmeonemails' )
+                                       $moreEmail
                                )
                        );
                }
@@ -888,10 +890,9 @@ class PreferencesForm {
                                } else {
                                        $formatted = $wgLang->timeanddate( $epoch, false, $key );
                                }
-                               $checked = ( $key == $this->mDate ) ? true : false;
                                $wgOut->addHTML(
                                        Xml::tags( 'div', null,
-                                               Xml::radioLabel( $formatted, 'wpDate', $key, "wpDate$idCnt", $checked )
+                                               Xml::radioLabel( $formatted, 'wpDate', $key, "wpDate$idCnt", $key == $this->mDate )
                                        ) . "\n"
                                );
                                $idCnt++;
@@ -910,7 +911,7 @@ class PreferencesForm {
                        $this->addRow( wfMsg( 'localtime' ), $nowlocal ) .
                        $this->addRow(
                                Xml::label( wfMsg( 'timezoneoffset' ), 'wpHourDiff'  ),
-                               Xml::input( 'wpHourDiff', 6, $this->mHourDiff, array( 'class' => 'wpHourDiff' ) ) ) .
+                               Xml::input( 'wpHourDiff', 6, $this->mHourDiff, array( 'id' => 'wpHourDiff' ) ) ) .
                        "<tr>
                                <td></td>
                                <td class='mw-submit'>" .