mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-27 09:00:04 +00:00
c32c64481d
To fix Phan errors with the now-deprecated ResourceLoaderContext class alias. Bug: T308718 Change-Id: Ifd265d29cee5f8a68e7b3036deaf2ba2b6c49d2e
24 lines
634 B
PHP
24 lines
634 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Skins\Vector\ResourceLoader;
|
|
|
|
use MediaWiki\ResourceLoader as RL;
|
|
use MediaWiki\Skins\Vector\Constants;
|
|
|
|
class VectorResourceLoaderUserModule extends RL\UserModule {
|
|
/**
|
|
* @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.js"] = [ 'type' => 'script' ];
|
|
}
|
|
return $pages;
|
|
}
|
|
}
|