MediaWiki REL1_32
CiteCSSFileModule.php
Go to the documentation of this file.
1<?php
2
10
11 public function __construct(
12 $options = [],
13 $localBasePath = null,
14 $remoteBasePath = null
15 ) {
16 global $wgContLang;
17
18 parent::__construct( $options, $localBasePath, $remoteBasePath );
19
20 // Get the content language code, and all the fallbacks. The first that
21 // has a ext.cite.style.<lang code>.css file present will be used.
22 $langCodes = array_merge( [ $wgContLang->getCode() ],
23 $wgContLang->getFallbackLanguages() );
24 foreach ( $langCodes as $lang ) {
25 $langStyleFile = 'ext.cite.style.' . $lang . '.css';
26 $localPath = $this->getLocalPath( $langStyleFile );
27 if ( file_exists( $localPath ) ) {
28 $this->styles[] = $langStyleFile;
29 break;
30 }
31 }
32 }
33
34}
$wgContLang
Definition Setup.php:809
ResourceLoaderFileModule for adding the content language Cite CSS.
__construct( $options=[], $localBasePath=null, $remoteBasePath=null)
Constructs a new module from an options array.
ResourceLoader module based on local JavaScript/CSS files.
string $localBasePath
Local base path, see __construct()
string $remoteBasePath
Remote base path, see __construct()
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
Definition hooks.txt:2050
if(!isset( $args[0])) $lang