MediaWiki
REL1_37
ResourceLoaderSiteStylesModule.php
Go to the documentation of this file.
1
<?php
29
class
ResourceLoaderSiteStylesModule
extends
ResourceLoaderWikiModule
{
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:34
ResourceLoaderContext\getSkin
getSkin()
Definition
ResourceLoaderContext.php:215
ResourceLoaderModule\getConfig
getConfig()
Definition
ResourceLoaderModule.php:234
ResourceLoaderModule\getHookRunner
getHookRunner()
Get a HookRunner for running core hooks.
Definition
ResourceLoaderModule.php:284
ResourceLoaderSiteStylesModule
Module for site style customizations.
Definition
ResourceLoaderSiteStylesModule.php:29
ResourceLoaderSiteStylesModule\getGroup
getGroup()
Definition
ResourceLoaderSiteStylesModule.php:61
ResourceLoaderSiteStylesModule\getType
getType()
Definition
ResourceLoaderSiteStylesModule.php:54
ResourceLoaderSiteStylesModule\getPages
getPages(ResourceLoaderContext $context)
Get list of pages used by this module.
Definition
ResourceLoaderSiteStylesModule.php:39
ResourceLoaderSiteStylesModule\$targets
string[] $targets
What client platforms the module targets (e.g.
Definition
ResourceLoaderSiteStylesModule.php:31
ResourceLoaderWikiModule
Abstraction for ResourceLoader modules which pull from wiki pages.
Definition
ResourceLoaderWikiModule.php:56
includes
resourceloader
ResourceLoaderSiteStylesModule.php
Generated on Fri Apr 5 2024 23:40:45 for MediaWiki by
1.9.8