MediaWiki  1.34.0
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 }
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:117
$lang
if(!isset( $args[0])) $lang
Definition: testCompression.php:33
ResourceLoaderFileModule
Module based on local JavaScript/CSS files.
Definition: ResourceLoaderFileModule.php:35
ResourceLoaderFileModule\$localBasePath
string $localBasePath
Local base path, see __construct()
Definition: ResourceLoaderFileModule.php:38
ResourceLoaderFileModule\getLocalPath
getLocalPath( $path)
Definition: ResourceLoaderFileModule.php:663
CiteCSSFileModule
ResourceLoaderFileModule for adding the content language Cite CSS.
Definition: CiteCSSFileModule.php:11
CiteCSSFileModule\__construct
__construct( $options=[], $localBasePath=null, $remoteBasePath=null)
Constructs a new module from an options array.
Definition: CiteCSSFileModule.php:13
ResourceLoaderFileModule\$remoteBasePath
string $remoteBasePath
Remote base path, see __construct()
Definition: ResourceLoaderFileModule.php:41