MediaWiki REL1_34
ResourceLoaderLessModule.php
Go to the documentation of this file.
1<?php
23namespace Vector;
24
25use CSSMin;
30
46 $lessVars = parent::getLessVars( $context );
47 try {
48 $config = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'vector' );
49 $printLogo = $config->get( 'VectorPrintLogo' );
50 } catch ( ConfigException $e ) {
51 // Config is not available when running in the context of the MediaWiki installer. (T183640)
52 $printLogo = false;
53 }
54 if ( $printLogo ) {
55 $lessVars[ 'printLogo' ] = true;
56 $lessVars[ 'printLogoUrl' ] = CSSMin::buildUrlValue( $printLogo['url'] );
57 $lessVars[ 'printLogoWidth' ] = intval( $printLogo['width'] );
58 $lessVars[ 'printLogoHeight' ] = intval( $printLogo['height'] );
59 } else {
60 $lessVars[ 'printLogo' ] = false;
61 }
62 return $lessVars;
63 }
64}
Transforms CSS data.
Definition CSSMin.php:30
Exceptions for config failures.
MediaWikiServices is the service locator for the application scope of MediaWiki.
Context object that contains information about the state of a specific ResourceLoader web request.
Module based on local JavaScript/CSS files.
ResourceLoader module for print styles.
getLessVars(ResourceLoaderContext $context)
Get language-specific LESS variables for this module.
$context
Definition load.php:45