mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-25 08:05:51 +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
719 B
PHP
28 lines
719 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Skins\Vector\ResourceLoader;
|
|
|
|
use MediaWiki\MainConfigNames;
|
|
use MediaWiki\ResourceLoader as RL;
|
|
use MediaWiki\Skins\Vector\Constants;
|
|
|
|
class VectorResourceLoaderUserModule extends RL\UserModule {
|
|
/**
|
|
* @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.js"] = [ 'type' => 'script' ];
|
|
}
|
|
return $pages;
|
|
}
|
|
}
|