MediaWiki master
SiteStylesModule.php
Go to the documentation of this file.
1<?php
10
12
20
27 protected function getPages( Context $context ) {
28 $pages = [];
29 if ( $this->getConfig()->get( MainConfigNames::UseSiteCss ) ) {
30 $skin = $context->getSkin();
31 $pages['MediaWiki:Common.css'] = [ 'type' => 'style' ];
32 $pages['MediaWiki:' . ucfirst( $skin ) . '.css'] = [ 'type' => 'style' ];
33 $pages['MediaWiki:Print.css'] = [ 'type' => 'style', 'media' => 'print' ];
34 $this->getHookRunner()->onResourceLoaderSiteStylesModulePages( $skin, $pages );
35 }
36 return $pages;
37 }
38
42 public function getType() {
43 return self::LOAD_STYLES;
44 }
45
49 public function getGroup() {
50 return self::GROUP_SITE;
51 }
52}
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:32
getHookRunner()
Get a HookRunner for running core hooks.
Definition Module.php:288
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.