hooks: implement PreferencesGetLayout

Use mobile layout in Special:Preferences

Bug: T320586
Depends-On: I468481b66bf96880d1779cd11a46e18745e2c894
Change-Id: Ic6aa01e6e8806d1f2be8e07ca6c83decd62bc641
This commit is contained in:
jsn 2022-10-12 08:37:28 -05:00
parent 8417343351
commit 48cdc5a33d
2 changed files with 16 additions and 0 deletions

View file

@ -96,6 +96,21 @@ class Hooks implements
}
}
/**
* PreferencesGetLayout hook handler.
*
* Use mobile layout in Special:Preferences
* @see https://phabricator.wikimedia.org/T311717
*
* @param bool &$useMobileLayout
* @param Skin $skin
*/
public static function onPreferencesGetLayout( &$useMobileLayout, Skin $skin ) {
if ( $skin->getSkinName() === 'minerva' ) {
$useMobileLayout = true;
}
}
/**
* Disable recent changes enhanced mode (table mode)
* @see https://www.mediawiki.org/wiki/Manual:Hooks/FetchChangesList

View file

@ -150,6 +150,7 @@
"RequestContextCreateSkinMobile": [
"MediaWiki\\Minerva\\Hooks::onRequestContextCreateSkinMobile"
],
"PreferencesGetLayout": "main",
"SpecialPageBeforeExecute": "main",
"ResourceLoaderGetConfigVars": "main",
"OutputPageBodyAttributes": "main"