mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-15 03:34:25 +00:00
e46eef19d0
- `MediaWiki\Skins\Vector\Tests` is now the prefix for all tests in the skin - we followed PSR conventions of following folder structure after the prefix - Optimize imports/use order - update namespace in skin.json Bug: T303102 Change-Id: Ib76374d81d973c83adfd6c8e7863ff6d797e655d
25 lines
695 B
PHP
25 lines
695 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Skins\Vector\ResourceLoader;
|
|
|
|
use MediaWiki\Skins\Vector\Constants;
|
|
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;
|
|
}
|
|
}
|