Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5964422
TimelessVariablesModule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
TimelessVariablesModule.php
View Options
<?php
namespace
MediaWiki\Skin\Timeless
;
use
MediaWiki\ResourceLoader\Context
;
use
MediaWiki\ResourceLoader\SkinModule
;
/**
* ResourceLoader module to set some LESS variables for the skin
*/
class
TimelessVariablesModule
extends
SkinModule
{
/**
* Add our LESS variables
*
* @param Context $context
* @return array LESS variables
*/
protected
function
getLessVars
(
Context
$context
)
{
$vars
=
parent
::
getLessVars
(
$context
);
$config
=
$this
->
getConfig
();
// Backdrop image
$backdrop
=
$config
->
get
(
'TimelessBackdropImage'
);
if
(
$backdrop
===
'cat.svg'
)
{
// expand default
$backdrop
=
'images/cat.svg'
;
}
return
array_merge
(
$vars
,
[
'backdrop-image'
=>
"url($backdrop)"
,
// 'logo-image' => ''
// 'wordmark-image' => ''
// +width cutoffs ...
]
);
}
/**
* Register the config var with the caching stuff so it properly updates the cache
*
* @param Context $context
* @return array
*/
public
function
getDefinitionSummary
(
Context
$context
)
{
$summary
=
parent
::
getDefinitionSummary
(
$context
);
$summary
[]
=
[
'TimelessBackdropImage'
=>
$this
->
getConfig
()->
get
(
'TimelessBackdropImage'
)
];
return
$summary
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 10:18 (1 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9c/b4/7f8ce0d1de541273501962726c20
Default Alt Text
TimelessVariablesModule.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment