Merge "Move disable of preference 'enotifminoredits'"
[lhc/web/wiklou.git] / includes / Preferences.php
index 54176a6..3f56240 100644 (file)
@@ -544,12 +544,14 @@ class Preferences {
                                ];
                        }
                        if ( $config->get( 'EnotifUserTalk' ) || $config->get( 'EnotifWatchlist' ) ) {
-                               $defaultPreferences['enotifminoredits'] = [
-                                       'type' => 'toggle',
-                                       'section' => 'personal/email',
-                                       'label-message' => 'tog-enotifminoredits',
-                                       'disabled' => $disableEmailPrefs,
-                               ];
+                               if ( $config->get( 'EnotifMinorEdits' ) ) {
+                                       $defaultPreferences['enotifminoredits'] = [
+                                               'type' => 'toggle',
+                                               'section' => 'personal/email',
+                                               'label-message' => 'tog-enotifminoredits',
+                                               'disabled' => $disableEmailPrefs,
+                                       ];
+                               }
 
                                if ( $config->get( 'EnotifRevealEditorAddress' ) ) {
                                        $defaultPreferences['enotifrevealaddr'] = [
@@ -1042,10 +1044,14 @@ class Preferences {
                        $watchTypes['rollback'] = 'watchrollback';
                }
 
+               if ( $user->isAllowed( 'upload' ) ) {
+                       $watchTypes['upload'] = 'watchuploads';
+               }
+
                foreach ( $watchTypes as $action => $pref ) {
                        if ( $user->isAllowed( $action ) ) {
                                // Messages:
-                               // tog-watchdefault, tog-watchmoves, tog-watchdeletion, tog-watchcreations
+                               // tog-watchdefault, tog-watchmoves, tog-watchdeletion, tog-watchcreations, tog-watchuploads
                                // tog-watchrollback
                                $defaultPreferences[$pref] = [
                                        'type' => 'toggle',
@@ -1301,6 +1307,7 @@ class Preferences {
 
                $htmlForm->setModifiedUser( $user );
                $htmlForm->setId( 'mw-prefs-form' );
+               $htmlForm->setAutocomplete( 'off' );
                $htmlForm->setSubmitText( $context->msg( 'saveprefs' )->text() );
                # Used message keys: 'accesskey-preferences-save', 'tooltip-preferences-save'
                $htmlForm->setSubmitTooltip( 'preferences-save' );