Merge "Do not show "Mark this page as patrolled" in print"
[lhc/web/wiklou.git] / includes / Preferences.php
index 2bb1e64..84a3b7e 100644 (file)
@@ -188,7 +188,8 @@ class Preferences {
                global $wgAuth, $wgContLang, $wgParser, $wgCookieExpiration, $wgLanguageCode,
                        $wgDisableTitleConversion, $wgDisableLangConversion, $wgMaxSigChars,
                        $wgEnableEmail, $wgEmailConfirmToEdit, $wgEnableUserEmail, $wgEmailAuthentication,
-                       $wgEnotifWatchlist, $wgEnotifUserTalk, $wgEnotifRevealEditorAddress;
+                       $wgEnotifWatchlist, $wgEnotifUserTalk, $wgEnotifRevealEditorAddress,
+                       $wgSecureLogin;
 
                // retrieving user name for GENDER and misc.
                $userName = $user->getName();
@@ -280,18 +281,6 @@ class Preferences {
                        'help-message' => 'prefs-help-realname',
                );
 
-               $defaultPreferences['gender'] = array(
-                       'type' => 'select',
-                       'section' => 'personal/info',
-                       'options' => array(
-                               $context->msg( 'gender-male' )->text() => 'male',
-                               $context->msg( 'gender-female' )->text() => 'female',
-                               $context->msg( 'gender-unknown' )->text() => 'unknown',
-                       ),
-                       'label-message' => 'yourgender',
-                       'help-message' => 'prefs-help-gender',
-               );
-
                if ( $canEditPrivateInfo && $wgAuth->allowPasswordChange() ) {
                        $link = Linker::link( SpecialPage::getTitleFor( 'ChangePassword' ),
                                $context->msg( 'prefs-resetpass' )->escaped(), array(),
@@ -313,6 +302,14 @@ class Preferences {
                                'section' => 'personal/info',
                        );
                }
+               // Only show preferhttps if secure login is turned on
+               if ( $wgSecureLogin && wfCanIPUseHTTPS( $context->getRequest()->getIP() ) ) {
+                       $defaultPreferences['prefershttps'] = array(
+                               'type' => 'toggle',
+                               'label-message' => 'tog-prefershttps',
+                               'section' => 'personal/info'
+                       );
+               }
 
                // Language
                $languages = Language::fetchLanguageNames( null, 'mw' );
@@ -333,6 +330,18 @@ class Preferences {
                        'label-message' => 'yourlanguage',
                );
 
+               $defaultPreferences['gender'] = array(
+                       'type' => 'radio',
+                       'section' => 'personal/i18n',
+                       'options' => array(
+                               $context->msg( 'gender-male' )->text() => 'male',
+                               $context->msg( 'gender-female' )->text() => 'female',
+                               $context->msg( 'gender-unknown' )->text() => 'unknown',
+                       ),
+                       'label-message' => 'yourgender',
+                       'help-message' => 'prefs-help-gender',
+               );
+
                // see if there are multiple language variants to choose from
                if ( !$wgDisableLangConversion ) {
                        foreach ( LanguageConverter::$languagesWithVariants as $langCode ) {