MediaWiki  master
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 }
ResourceLoaderContext
Context object that contains information about the state of a specific ResourceLoader web request.
Definition: ResourceLoaderContext.php:33
ResourceLoaderSiteStylesModule\getPages
getPages(ResourceLoaderContext $context)
Get list of pages used by this module.
Definition: ResourceLoaderSiteStylesModule.php:39
ResourceLoaderModule\getHookRunner
getHookRunner()
Get a HookRunner for running core hooks.
Definition: ResourceLoaderModule.php:269
ResourceLoaderWikiModule
Abstraction for ResourceLoader modules which pull from wiki pages.
Definition: ResourceLoaderWikiModule.php:55
ResourceLoaderSiteStylesModule\getType
getType()
Definition: ResourceLoaderSiteStylesModule.php:54
ResourceLoaderSiteStylesModule\getGroup
getGroup()
Definition: ResourceLoaderSiteStylesModule.php:61
ResourceLoaderContext\getSkin
getSkin()
Definition: ResourceLoaderContext.php:188
ResourceLoaderSiteStylesModule\$targets
string[] $targets
What client platforms the module targets (e.g.
Definition: ResourceLoaderSiteStylesModule.php:31
ResourceLoaderSiteStylesModule
Module for site style customizations.
Definition: ResourceLoaderSiteStylesModule.php:29
ResourceLoaderModule\getConfig
getConfig()
Definition: ResourceLoaderModule.php:218