MediaWiki REL1_34
CiteCSSFileModule.php
Go to the documentation of this file.
1<?php
2
4
12
13 public function __construct(
14 $options = [],
15 $localBasePath = null,
16 $remoteBasePath = null
17 ) {
18 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
19 parent::__construct( $options, $localBasePath, $remoteBasePath );
20
21 // Get the content language code, and all the fallbacks. The first that
22 // has a ext.cite.style.<lang code>.css file present will be used.
23 $langCodes = array_merge(
24 [ $contLang->getCode() ],
25 $contLang->getFallbackLanguages()
26 );
27 foreach ( $langCodes as $lang ) {
28 $langStyleFile = 'ext.cite.style.' . $lang . '.css';
29 $localPath = $this->getLocalPath( $langStyleFile );
30 if ( file_exists( $localPath ) ) {
31 $this->styles[] = $langStyleFile;
32 break;
33 }
34 }
35 }
36
37}
ResourceLoaderFileModule for adding the content language Cite CSS.
__construct( $options=[], $localBasePath=null, $remoteBasePath=null)
Constructs a new module from an options array.
MediaWikiServices is the service locator for the application scope of MediaWiki.
Module based on local JavaScript/CSS files.
string $localBasePath
Local base path, see __construct()
string $remoteBasePath
Remote base path, see __construct()
if(!isset( $args[0])) $lang