mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 07:43:47 +00:00
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.
|
||||
*
|
||||
|
|
|
@ -129,6 +129,7 @@
|
|||
"Vector\\": "includes/"
|
||||
},
|
||||
"Hooks": {
|
||||
"GetPreferences": "Vector\\Hooks::onGetPreferences",
|
||||
"ResourceLoaderSiteModulePages": "Vector\\Hooks::onResourceLoaderSiteModulePages",
|
||||
"ResourceLoaderSiteStylesModulePages": "Vector\\Hooks::onResourceLoaderSiteStylesModulePages",
|
||||
"SkinPageReadyConfig": "Vector\\Hooks::onSkinPageReadyConfig",
|
||||
|
|
Loading…
Reference in a new issue