MediaWiki  master
SiteStylesModule.php
Go to the documentation of this file.
1 <?php
23 namespace MediaWiki\ResourceLoader;
24 
26 
35  protected $targets = [ 'desktop', 'mobile' ];
36 
43  protected function getPages( Context $context ) {
44  $pages = [];
45  if ( $this->getConfig()->get( MainConfigNames::UseSiteCss ) ) {
46  $skin = $context->getSkin();
47  $pages['MediaWiki:Common.css'] = [ 'type' => 'style' ];
48  $pages['MediaWiki:' . ucfirst( $skin ) . '.css'] = [ 'type' => 'style' ];
49  $pages['MediaWiki:Print.css'] = [ 'type' => 'style', 'media' => 'print' ];
50  $this->getHookRunner()->onResourceLoaderSiteStylesModulePages( $skin, $pages );
51  }
52  return $pages;
53  }
54 
58  public function getType() {
59  return self::LOAD_STYLES;
60  }
61 
65  public function getGroup() {
66  return self::GROUP_SITE;
67  }
68 }
69 
71 class_alias( SiteStylesModule::class, 'ResourceLoaderSiteStylesModule' );
A class containing constants representing the names of configuration variables.
const UseSiteCss
Name constant for the UseSiteCss setting, for use with Config::get()
Context object that contains information about the state of a specific ResourceLoader web request.
Definition: Context.php:46
getHookRunner()
Get a HookRunner for running core hooks.
Definition: Module.php:304
Module for site style customizations.
string[] $targets
What client platforms the module targets (e.g.
getPages(Context $context)
Get list of pages used by this module.
Abstraction for ResourceLoader modules which pull from wiki pages.
Definition: WikiModule.php:65