From: MatmaRex Date: Fri, 9 Aug 2013 17:53:30 +0000 (+0200) Subject: Remove "Misc" tab from Special:Preferences X-Git-Tag: 1.31.0-rc.0~18774^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=8dd562d4daba13976501af39eea0248897579e31;p=lhc%2Fweb%2Fwiklou.git Remove "Misc" tab from Special:Preferences 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 --- diff --git a/includes/Preferences.php b/includes/Preferences.php index 709f15cba3..159127a0ab 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -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", - ); - } } /**