Merge "Do not run tests that depend on curl if it is not loaded"
[lhc/web/wiklou.git] / includes / Preferences.php
index 0bb1d28..a7e6684 100644 (file)
@@ -554,6 +554,22 @@ class Preferences {
                                        'label-message' => 'tog-ccmeonemails',
                                        'disabled' => $disableEmailPrefs,
                                ];
+
+                               if ( $config->get( 'EnableUserEmailBlacklist' )
+                                        && !$disableEmailPrefs
+                                        && !(bool)$user->getOption( 'disablemail' )
+                               ) {
+                                       $lookup = CentralIdLookup::factory();
+                                       $ids = $user->getOption( 'email-blacklist', [] );
+                                       $names = $ids ? $lookup->namesFromCentralIds( $ids, $user ) : [];
+
+                                       $defaultPreferences['email-blacklist'] = [
+                                               'type' => 'usersmultiselect',
+                                               'label-message' => 'email-blacklist-label',
+                                               'section' => 'personal/email',
+                                               'default' => implode( "\n", $names ),
+                                       ];
+                               }
                        }
 
                        if ( $config->get( 'EnotifWatchlist' ) ) {
@@ -609,7 +625,6 @@ class Preferences {
                        $defaultPreferences['skin'] = [
                                'type' => 'radio',
                                'options' => $skinOptions,
-                               'label' => ' ',
                                'section' => 'rendering/skin',
                        ];
                }
@@ -679,7 +694,6 @@ class Preferences {
                        $defaultPreferences['date'] = [
                                'type' => 'radio',
                                'options' => $dateOptions,
-                               'label' => ' ',
                                'section' => 'rendering/dateformat',
                        ];
                }
@@ -960,7 +974,7 @@ class Preferences {
                if ( $config->get( 'StructuredChangeFiltersShowPreference' ) ) {
                        $defaultPreferences['rcenhancedfilters-disable'] = [
                                'type' => 'toggle',
-                               'section' => 'rc/advancedrc',
+                               'section' => 'rc/opt-out',
                                'label-message' => 'rcfilters-preference-label',
                                'help-message' => 'rcfilters-preference-help',
                        ];
@@ -1363,7 +1377,7 @@ class Preferences {
                $htmlForm->setSubmitText( $context->msg( 'saveprefs' )->text() );
                # Used message keys: 'accesskey-preferences-save', 'tooltip-preferences-save'
                $htmlForm->setSubmitTooltip( 'preferences-save' );
-               $htmlForm->setSubmitID( 'prefsubmit' );
+               $htmlForm->setSubmitID( 'prefcontrol' );
                $htmlForm->setSubmitCallback( [ 'Preferences', 'tryFormSubmit' ] );
 
                return $htmlForm;