Remove "Misc" tab from Special:Preferences
authorMatmaRex <matma.rex@gmail.com>
Fri, 9 Aug 2013 17:53:30 +0000 (19:53 +0200)
committerMatmarex <matma.rex@gmail.com>
Mon, 12 Aug 2013 20:45:53 +0000 (20:45 +0000)
It has served us faithfully for many years, but now, after most of its
contents have been moved to other tabs, it only contained one section
with two options related to diffs in it. Moved these two as well to
"Appearance" tab where they rightfully belong.

Also moved some code potentially adding items to the personal/i18n
section out of the misc part and to the personal part, where it should
have always been in the first place. (This actually appears to be dead
code, as $extraUserToggles doesn't seem to be defined for any language
- marked as FIXME.)

The Preferences::miscPreferences() function doesn't do anything now,
but kept it and its only call just in case for backwards-compatibility.

Bug: 52084
Change-Id: I537abc9884e18acf3ff9a425241de4607dfd7c33

includes/Preferences.php

index 709f15c..159127a 100644 (file)
@@ -369,6 +369,18 @@ class Preferences {
                        }
                }
 
+               // Stuff from Language::getExtraUserToggles()
+               // FIXME is this dead code? $extraUserToggles doesn't seem to be defined for any language
+               $toggles = $wgContLang->getExtraUserToggles();
+
+               foreach ( $toggles as $toggle ) {
+                       $defaultPreferences[$toggle] = array(
+                               'type' => 'toggle',
+                               'section' => 'personal/i18n',
+                               'label-message' => "tog-$toggle",
+                       );
+               }
+
                // show a preview of the old signature first
                $oldsigWikiText = $wgParser->preSaveTransform( "~~~", $context->getTitle(), $user, ParserOptions::newFromContext( $context ) );
                $oldsigHTML = $context->getOutput()->parseInline( $oldsigWikiText, true, true );
@@ -675,6 +687,18 @@ class Preferences {
         * @param $defaultPreferences Array
         */
        static function renderingPreferences( $user, IContextSource $context, &$defaultPreferences ) {
+               ## Diffs ####################################
+               $defaultPreferences['diffonly'] = array(
+                       'type' => 'toggle',
+                       'section' => 'rendering/diffs',
+                       'label-message' => 'tog-diffonly',
+               );
+               $defaultPreferences['norollbackdiff'] = array(
+                       'type' => 'toggle',
+                       'section' => 'rendering/diffs',
+                       'label-message' => 'tog-norollbackdiff',
+               );
+
                ## Page Rendering ##############################
                global $wgAllowUserCssPrefs;
                if ( $wgAllowUserCssPrefs ) {
@@ -1045,35 +1069,9 @@ class Preferences {
        }
 
        /**
-        * @param $user User
-        * @param $context IContextSource
-        * @param $defaultPreferences Array
+        * Dummy, kept for backwards-compatibility.
         */
        static function miscPreferences( $user, IContextSource $context, &$defaultPreferences ) {
-               global $wgContLang;
-
-               ## Misc #####################################
-               $defaultPreferences['diffonly'] = array(
-                       'type' => 'toggle',
-                       'section' => 'misc/diffs',
-                       'label-message' => 'tog-diffonly',
-               );
-               $defaultPreferences['norollbackdiff'] = array(
-                       'type' => 'toggle',
-                       'section' => 'misc/diffs',
-                       'label-message' => 'tog-norollbackdiff',
-               );
-
-               // Stuff from Language::getExtraUserToggles()
-               $toggles = $wgContLang->getExtraUserToggles();
-
-               foreach ( $toggles as $toggle ) {
-                       $defaultPreferences[$toggle] = array(
-                               'type' => 'toggle',
-                               'section' => 'personal/i18n',
-                               'label-message' => "tog-$toggle",
-                       );
-               }
        }
 
        /**