mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 15:53:46 +00:00
5c1d5c6c9b
Currently Vector 2022 skin loads Vector and Vector-2022 site and user styles. Some wikis have complained this is confusing, and want to move away from this. Since this is potentially a disruptive change, it is better to defer to communities on how they want to handle this migration internally, but they should have the means to turn it off when they've done that. Bug: T301212 Change-Id: I132e3695ad282dd7c7ce9037688043c62c2e2aa4
28 lines
731 B
PHP
28 lines
731 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Skins\Vector\ResourceLoader;
|
|
|
|
use MediaWiki\MainConfigNames;
|
|
use MediaWiki\ResourceLoader as RL;
|
|
use MediaWiki\Skins\Vector\Constants;
|
|
|
|
class VectorResourceLoaderUserStylesModule extends RL\UserStylesModule {
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
protected function getPages( RL\Context $context ) {
|
|
$user = $context->getUserObj();
|
|
$pages = [];
|
|
$config = $this->getConfig();
|
|
if ( $context->getSkin() === Constants::SKIN_NAME_MODERN &&
|
|
$config->get( 'VectorShareUserScripts' ) &&
|
|
$config->get( MainConfigNames::AllowUserCss ) &&
|
|
$user->isRegistered()
|
|
) {
|
|
$userPage = $user->getUserPage()->getPrefixedDBkey();
|
|
$pages["$userPage/vector.css"] = [ 'type' => 'style' ];
|
|
}
|
|
return $pages;
|
|
}
|
|
}
|