MediaWiki
REL1_37
ResourceLoaderSiteModule.php
Go to the documentation of this file.
1
<?php
29
class
ResourceLoaderSiteModule
extends
ResourceLoaderWikiModule
{
31
protected
$targets
= [
'desktop'
,
'mobile'
];
32
39
protected
function
getPages
(
ResourceLoaderContext
$context ) {
40
$pages = [];
41
if
( $this->
getConfig
()->
get
(
'UseSiteJs'
) ) {
42
$skin = $context->
getSkin
();
43
$pages[
'MediaWiki:Common.js'
] = [
'type'
=>
'script'
];
44
$pages[
'MediaWiki:'
. ucfirst( $skin ) .
'.js'
] = [
'type'
=>
'script'
];
45
$this->
getHookRunner
()->onResourceLoaderSiteModulePages( $skin, $pages );
46
}
47
return
$pages;
48
}
49
54
public
function
getDependencies
(
ResourceLoaderContext
$context =
null
) {
55
return
[
'site.styles'
];
56
}
57
}
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
ResourceLoaderSiteModule
Module for site customizations.
Definition
ResourceLoaderSiteModule.php:29
ResourceLoaderSiteModule\getPages
getPages(ResourceLoaderContext $context)
Get list of pages used by this module.
Definition
ResourceLoaderSiteModule.php:39
ResourceLoaderSiteModule\getDependencies
getDependencies(ResourceLoaderContext $context=null)
Definition
ResourceLoaderSiteModule.php:54
ResourceLoaderSiteModule\$targets
string[] $targets
What client platforms the module targets (e.g.
Definition
ResourceLoaderSiteModule.php:31
ResourceLoaderWikiModule
Abstraction for ResourceLoader modules which pull from wiki pages.
Definition
ResourceLoaderWikiModule.php:56
includes
resourceloader
ResourceLoaderSiteModule.php
Generated on Fri Apr 5 2024 23:40:45 for MediaWiki by
1.9.8