Restore persistent sidebar
Bug: T305989 Change-Id: I1304c777ad9581cd8b9153ad1e4483e31660857e
This commit is contained in:
parent
79cde24aff
commit
f38a2afbf6
|
@ -447,6 +447,25 @@ class Hooks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the persistent sidebar hidden API preference.
|
||||||
|
*
|
||||||
|
* @param User $user User whose preferences are being modified.
|
||||||
|
* @param array[] &$prefs Preferences description array, to be fed to a HTMLForm object.
|
||||||
|
*/
|
||||||
|
public static function onGetPreferences( User $user, array &$prefs ) {
|
||||||
|
$config = MediaWikiServices::getInstance()->getMainConfig();
|
||||||
|
$vectorPrefs = [
|
||||||
|
Constants::PREF_KEY_SIDEBAR_VISIBLE => [
|
||||||
|
'type' => 'api',
|
||||||
|
'default' => $config->get(
|
||||||
|
Constants::CONFIG_KEY_DEFAULT_SIDEBAR_VISIBLE_FOR_AUTHORISED_USER
|
||||||
|
),
|
||||||
|
],
|
||||||
|
];
|
||||||
|
$prefs += $vectorPrefs;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called one time when initializing a users preferences for a newly created account.
|
* Called one time when initializing a users preferences for a newly created account.
|
||||||
*
|
*
|
||||||
|
|
|
@ -129,6 +129,7 @@
|
||||||
"Vector\\": "includes/"
|
"Vector\\": "includes/"
|
||||||
},
|
},
|
||||||
"Hooks": {
|
"Hooks": {
|
||||||
|
"GetPreferences": "Vector\\Hooks::onGetPreferences",
|
||||||
"ResourceLoaderSiteModulePages": "Vector\\Hooks::onResourceLoaderSiteModulePages",
|
"ResourceLoaderSiteModulePages": "Vector\\Hooks::onResourceLoaderSiteModulePages",
|
||||||
"ResourceLoaderSiteStylesModulePages": "Vector\\Hooks::onResourceLoaderSiteStylesModulePages",
|
"ResourceLoaderSiteStylesModulePages": "Vector\\Hooks::onResourceLoaderSiteStylesModulePages",
|
||||||
"SkinPageReadyConfig": "Vector\\Hooks::onSkinPageReadyConfig",
|
"SkinPageReadyConfig": "Vector\\Hooks::onSkinPageReadyConfig",
|
||||||
|
|
Loading…
Reference in a new issue