mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 07:43:47 +00:00
c32c64481d
To fix Phan errors with the now-deprecated ResourceLoaderContext class alias. Bug: T308718 Change-Id: Ifd265d29cee5f8a68e7b3036deaf2ba2b6c49d2e
24 lines
646 B
PHP
24 lines
646 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Skins\Vector\ResourceLoader;
|
|
|
|
use MediaWiki\ResourceLoader as RL;
|
|
use MediaWiki\Skins\Vector\Constants;
|
|
|
|
class VectorResourceLoaderUserStylesModule extends RL\UserStylesModule {
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
protected function getPages( RL\Context $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;
|
|
}
|
|
}
|