MediaWiki REL1_37
ResourceLoaderSiteStylesModule.php
Go to the documentation of this file.
1<?php
31 protected $targets = [ 'desktop', 'mobile' ];
32
39 protected function getPages( ResourceLoaderContext $context ) {
40 $pages = [];
41 if ( $this->getConfig()->get( 'UseSiteCss' ) ) {
42 $skin = $context->getSkin();
43 $pages['MediaWiki:Common.css'] = [ 'type' => 'style' ];
44 $pages['MediaWiki:' . ucfirst( $skin ) . '.css'] = [ 'type' => 'style' ];
45 $pages['MediaWiki:Print.css'] = [ 'type' => 'style', 'media' => 'print' ];
46 $this->getHookRunner()->onResourceLoaderSiteStylesModulePages( $skin, $pages );
47 }
48 return $pages;
49 }
50
54 public function getType() {
55 return self::LOAD_STYLES;
56 }
57
61 public function getGroup() {
62 return 'site';
63 }
64}
Context object that contains information about the state of a specific ResourceLoader web request.
getHookRunner()
Get a HookRunner for running core hooks.
Module for site style customizations.
getPages(ResourceLoaderContext $context)
Get list of pages used by this module.
string[] $targets
What client platforms the module targets (e.g.
Abstraction for ResourceLoader modules which pull from wiki pages.