X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoaderUserModule.php;h=8e213819f6087339cbeb06e76d795890c33aef9c;hp=8d4f263493a5ec3ec2b3aa1a597fa30f235a81b0;hb=3df3b575c6617df64ec98533cc7141bd2314e274;hpb=425090d4eb0b9de89ad6818f40ab8295368f645e diff --git a/includes/resourceloader/ResourceLoaderUserModule.php b/includes/resourceloader/ResourceLoaderUserModule.php index 8d4f263493..8e213819f6 100644 --- a/includes/resourceloader/ResourceLoaderUserModule.php +++ b/includes/resourceloader/ResourceLoaderUserModule.php @@ -1,7 +1,5 @@ getSkin() . '.js'] = [ 'type' => 'script' ]; } - if ( $config->get( 'AllowUserCss' ) ) { - $pages["$userPage/common.css"] = [ 'type' => 'style' ]; - $pages["$userPage/" . $context->getSkin() . '.css'] = [ 'type' => 'style' ]; - } - - $useSiteJs = $config->get( 'UseSiteJs' ); - $useSiteCss = $config->get( 'UseSiteCss' ); // User group pages are maintained site-wide and enabled with site JS/CSS. - if ( $useSiteJs || $useSiteCss ) { + if ( $config->get( 'UseSiteJs' ) ) { foreach ( $user->getEffectiveGroups() as $group ) { if ( $group == '*' ) { continue; } - if ( $useSiteJs ) { - $pages["MediaWiki:Group-$group.js"] = [ 'type' => 'script' ]; - } - if ( $useSiteCss ) { - $pages["MediaWiki:Group-$group.css"] = [ 'type' => 'style' ]; - } + $pages["MediaWiki:Group-$group.js"] = [ 'type' => 'script' ]; } } - // Hack for bug 26283: if we're on a preview page for a CSS/JS page, - // we need to exclude that page from this module. In that case, the excludepage - // parameter will be set to the name of the page we need to exclude. + // Hack for T28283: Allow excluding pages for preview on a CSS/JS page. + // The excludepage parameter is set by OutputPage. $excludepage = $context->getRequest()->getVal( 'excludepage' ); if ( isset( $pages[$excludepage] ) ) { - // This works because $excludepage is generated with getPrefixedDBkey(), - // just like the keys in $pages[] above unset( $pages[$excludepage] ); } @@ -95,4 +76,12 @@ class ResourceLoaderUserModule extends ResourceLoaderWikiModule { public function getGroup() { return 'user'; } + + /** + * @param ResourceLoaderContext|null $context + * @return array + */ + public function getDependencies( ResourceLoaderContext $context = null ) { + return [ 'user.styles' ]; + } }