mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-29 01:45:00 +00:00
f9d9ddcbec
And while we are here: * Split long lines. * Use isRegistered from the more narrow UserIdentity interface. * Sort conditions from (probably) least to most expensive. Change-Id: Ia6e4018a22cfc2fb450bb53f6d63a4a106394b87
26 lines
651 B
PHP
26 lines
651 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 = [];
|
|
if ( $context->getSkin() === Constants::SKIN_NAME_MODERN &&
|
|
$this->getConfig()->get( MainConfigNames::AllowUserCss ) &&
|
|
$user->isRegistered()
|
|
) {
|
|
$userPage = $user->getUserPage()->getPrefixedDBkey();
|
|
$pages["$userPage/vector.js"] = [ 'type' => 'script' ];
|
|
}
|
|
return $pages;
|
|
}
|
|
}
|