mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-30 10:26:03 +00:00
25 lines
663 B
PHP
25 lines
663 B
PHP
|
<?php
|
||
|
|
||
|
namespace Vector\ResourceLoader;
|
||
|
|
||
|
use ResourceLoaderContext;
|
||
|
use ResourceLoaderUserStylesModule;
|
||
|
use Vector\Constants;
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
}
|