X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FPreferences.php;h=33a975d104718a5b2e3c62dad17bf51a3efc9a49;hb=d9ba5906d0da6ea24705ba53ce6584c1ca8716bb;hp=cab1e1f3e108f8fa67432dbb83cdf9117697df17;hpb=490035943c8a2baca02530bcecb7542feb1eea3e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Preferences.php b/includes/Preferences.php index cab1e1f3e1..33a975d104 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -534,12 +534,22 @@ class Preferences { if ( $config->get( 'EnableUserEmail' ) && $user->isAllowed( 'sendemail' ) ) { $defaultPreferences['disablemail'] = [ + 'id' => 'wpAllowEmail', 'type' => 'toggle', 'invert' => true, 'section' => 'personal/email', 'label-message' => 'allowemail', 'disabled' => $disableEmailPrefs, ]; + + $defaultPreferences['email-allow-new-users'] = [ + 'id' => 'wpAllowEmailFromNewUsers', + 'type' => 'toggle', + 'section' => 'personal/email', + 'label-message' => 'email-allow-new-users-label', + 'disabled' => $disableEmailPrefs, + ]; + $defaultPreferences['ccmeonemails'] = [ 'type' => 'toggle', 'section' => 'personal/email', @@ -547,10 +557,7 @@ class Preferences { 'disabled' => $disableEmailPrefs, ]; - if ( $config->get( 'EnableUserEmailBlacklist' ) - && !$disableEmailPrefs - && !(bool)$user->getOption( 'disablemail' ) - ) { + if ( $config->get( 'EnableUserEmailBlacklist' ) ) { $lookup = CentralIdLookup::factory(); $ids = $user->getOption( 'email-blacklist', [] ); $names = $ids ? $lookup->namesFromCentralIds( $ids, $user ) : []; @@ -560,6 +567,7 @@ class Preferences { 'label-message' => 'email-blacklist-label', 'section' => 'personal/email', 'default' => implode( "\n", $names ), + 'disabled' => $disableEmailPrefs, ]; } } @@ -1171,21 +1179,31 @@ class Preferences { # Only show skins that aren't disabled in $wgSkipSkins $validSkinNames = Skin::getAllowedSkins(); - # Sort by UI skin name. First though need to update validSkinNames as sometimes - # the skinkey & UI skinname differ (e.g. "standard" skinkey is "Classic" in the UI). foreach ( $validSkinNames as $skinkey => &$skinname ) { $msg = $context->msg( "skinname-{$skinkey}" ); if ( $msg->exists() ) { $skinname = htmlspecialchars( $msg->text() ); } } - asort( $validSkinNames ); $config = $context->getConfig(); $defaultSkin = $config->get( 'DefaultSkin' ); $allowUserCss = $config->get( 'AllowUserCss' ); $allowUserJs = $config->get( 'AllowUserJs' ); + # Sort by the internal name, so that the ordering is the same for each display language, + # especially if some skin names are translated to use a different alphabet and some are not. + uksort( $validSkinNames, function ( $a, $b ) use ( $defaultSkin ) { + # Display the default first in the list by comparing it as lesser than any other. + if ( strcasecmp( $a, $defaultSkin ) === 0 ) { + return -1; + } + if ( strcasecmp( $b, $defaultSkin ) === 0 ) { + return 1; + } + return strcasecmp( $a, $b ); + } ); + $foundDefault = false; foreach ( $validSkinNames as $skinkey => $sn ) { $linkTools = [];