2021-12-14 21:59:16 +00:00
|
|
|
<?php
|
|
|
|
|
2022-05-23 07:32:40 +00:00
|
|
|
namespace MediaWiki\Skins\Vector\ResourceLoader;
|
2021-12-14 21:59:16 +00:00
|
|
|
|
2022-05-23 07:32:40 +00:00
|
|
|
use MediaWiki\Skins\Vector\Constants;
|
2021-12-14 21:59:16 +00:00
|
|
|
use ResourceLoaderContext;
|
|
|
|
use ResourceLoaderUserStylesModule;
|
|
|
|
|
|
|
|
class VectorResourceLoaderUserStylesModule extends ResourceLoaderUserStylesModule {
|
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
|
|
|
protected function getPages( ResourceLoaderContext $context ) {
|
|
|
|
$skin = $context->getSkin();
|
|
|
|
$config = $this->getConfig();
|
|
|
|
$user = $context->getUserObj();
|
|
|
|
$pages = [];
|
|
|
|
if ( $config->get( 'AllowUserCss' ) && !$user->isAnon() && ( $skin === Constants::SKIN_NAME_MODERN ) ) {
|
|
|
|
$userPage = $user->getUserPage()->getPrefixedDBkey();
|
|
|
|
$pages["$userPage/vector.css"] = [ 'type' => 'style' ];
|
|
|
|
}
|
|
|
|
return $pages;
|
|
|
|
}
|
|
|
|
}
|