MediaWiki REL1_40
SiteStylesModule.php
Go to the documentation of this file.
1<?php
24
26
34
41 protected function getPages( Context $context ) {
42 $pages = [];
43 if ( $this->getConfig()->get( MainConfigNames::UseSiteCss ) ) {
44 $skin = $context->getSkin();
45 $pages['MediaWiki:Common.css'] = [ 'type' => 'style' ];
46 $pages['MediaWiki:' . ucfirst( $skin ) . '.css'] = [ 'type' => 'style' ];
47 $pages['MediaWiki:Print.css'] = [ 'type' => 'style', 'media' => 'print' ];
48 $this->getHookRunner()->onResourceLoaderSiteStylesModulePages( $skin, $pages );
49 }
50 return $pages;
51 }
52
56 public function getType() {
57 return self::LOAD_STYLES;
58 }
59
63 public function getGroup() {
64 return self::GROUP_SITE;
65 }
66}
67
69class_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.
getPages(Context $context)
Get list of pages used by this module.
Abstraction for ResourceLoader modules which pull from wiki pages.