MediaWiki
1.34.0
TimelessVariablesModule.php
Go to the documentation of this file.
1
<?php
5
class
TimelessVariablesModule
extends
ResourceLoaderSkinModule
{
12
protected
function
getLessVars
(
ResourceLoaderContext
$context
) {
13
$vars = parent::getLessVars(
$context
);
14
$config
= $this->
getConfig
();
15
16
// Backdrop image
17
$backdrop =
$config
->
get
(
'TimelessBackdropImage'
);
18
19
if
( $backdrop ===
'cat.svg'
) {
20
// expand default
21
$backdrop =
'images/cat.svg'
;
22
}
23
24
$vars = array_merge(
25
$vars,
26
[
27
'backdrop-image'
=>
"url($backdrop)"
,
28
// 'logo-image' => ''
29
// 'wordmark-image' => ''
30
// +width cutoffs ...
31
]
32
);
33
34
return
$vars;
35
}
36
43
public
function
getDefinitionSummary
(
ResourceLoaderContext
$context
) {
44
$summary = parent::getDefinitionSummary(
$context
);
45
$summary[] = [
46
'TimelessBackdropImage'
=> $this->
getConfig
()->get(
'TimelessBackdropImage'
)
47
];
48
return
$summary;
49
}
50
}
ResourceLoaderContext
Context object that contains information about the state of a specific ResourceLoader web request.
Definition:
ResourceLoaderContext.php:33
TimelessVariablesModule\getDefinitionSummary
getDefinitionSummary(ResourceLoaderContext $context)
Register the config var with the caching stuff so it properly updates the cache.
Definition:
TimelessVariablesModule.php:43
TimelessVariablesModule
ResourceLoader module to set some LESS variables for the skin.
Definition:
TimelessVariablesModule.php:5
Config\get
get( $name)
Get a configuration variable such as "Sitename" or "UploadMaintenance.".
TimelessVariablesModule\getLessVars
getLessVars(ResourceLoaderContext $context)
Add our LESS variables.
Definition:
TimelessVariablesModule.php:12
$context
$context
Definition:
load.php:45
ResourceLoaderModule\$config
Config $config
Definition:
ResourceLoaderModule.php:39
ResourceLoaderSkinModule
Module for skin stylesheets.
Definition:
ResourceLoaderSkinModule.php:27
ResourceLoaderModule\getConfig
getConfig()
Definition:
ResourceLoaderModule.php:200
skins
Timeless
includes
TimelessVariablesModule.php
Generated on Thu Dec 19 2019 14:55:36 for MediaWiki by
1.8.16