Extend new config flag to site styles

Bug: T301212
Change-Id: I50d898a541707063594dfbc16a6bbfaabab42162
This commit is contained in:
Jon Robson 2023-03-09 10:08:36 -08:00 committed by Jdlrobson
parent 182cbf968f
commit 26d5d44535

View file

@ -590,7 +590,8 @@ class Hooks implements
* @param array &$pages
*/
public function onResourceLoaderSiteStylesModulePages( $skin, &$pages ): void {
if ( $skin === Constants::SKIN_NAME_MODERN ) {
$config = MediaWikiServices::getInstance()->getMainConfig();
if ( $skin === Constants::SKIN_NAME_MODERN && $config->get( 'VectorShareUserScripts' ) ) {
$pages['MediaWiki:Vector.css'] = [ 'type' => 'style' ];
}
}
@ -602,7 +603,8 @@ class Hooks implements
* @param array &$pages
*/
public function onResourceLoaderSiteModulePages( $skin, &$pages ): void {
if ( $skin === Constants::SKIN_NAME_MODERN ) {
$config = MediaWikiServices::getInstance()->getMainConfig();
if ( $skin === Constants::SKIN_NAME_MODERN && $config->get( 'VectorShareUserScripts' ) ) {
$pages['MediaWiki:Vector.js'] = [ 'type' => 'script' ];
}
}