* @return string
*/
public function getCSS() {
- // Horrible, horrible hack: the installer is currently hardcoded to use the Vector skin, so load
- // it here. Include instead of require, as this will work without it, it will just look bad.
global $wgStyleDirectory;
- include_once "$wgStyleDirectory/Vector/Vector.php";
$moduleNames = array(
// See SkinTemplate::setupSkinUserCss
'mediawiki.legacy.shared',
// See Vector::setupSkinUserCss
'mediawiki.skinning.interface',
- 'skins.vector.styles',
-
- 'mediawiki.legacy.config',
);
- $css = '';
+ if ( file_exists( "$wgStyleDirectory/Vector/Vector.php" ) ) {
+ // Force loading Vector skin if available as a fallback skin
+ // for whatever ResourceLoader wants to have as the default.
+
+ // Include instead of require, as this will work without it, it will just look bad.
+ // We need the 'global' statement for $wgResourceModules because the Vector skin adds the
+ // definitions for its RL modules there that we use implicitly below.
+
+ // @codingStandardsIgnoreStart
+ global $wgResourceModules; // This is NOT UNUSED!
+ // @codingStandardsIgnoreEnd
+
+ include_once "$wgStyleDirectory/Vector/Vector.php";
+
+ $moduleNames[] = 'skins.vector.styles';
+ }
+
+ $moduleNames[] = 'mediawiki.legacy.config';
$resourceLoader = new ResourceLoader();
$rlContext = new ResourceLoaderContext( $resourceLoader, new FauxRequest( array(
'debug' => 'true',
'lang' => $this->getLanguageCode(),
'only' => 'styles',
- 'skin' => 'vector',
) ) );
+
+ $styles = array();
foreach ( $moduleNames as $moduleName ) {
/** @var ResourceLoaderFileModule $module */
$module = $resourceLoader->getModule( $moduleName );
- // One of the modules will be missing if Vector is unavailable
- if ( !$module ) {
- continue;
- }
// Based on: ResourceLoaderFileModule::getStyles (without the DB query)
- $styles = ResourceLoader::makeCombinedStyles( $module->readStyleFiles(
- $module->getStyleFiles( $rlContext ),
- $module->getFlip( $rlContext )
- ) );
-
- $css .= implode( "\n", $styles );
+ $styles = array_merge( $styles, ResourceLoader::makeCombinedStyles(
+ $module->readStyleFiles(
+ $module->getStyleFiles( $rlContext ),
+ $module->getFlip( $rlContext )
+ ) ) );
}
- return $css;
+ return implode( "\n", $styles );
}
/**
public function getHeadAttribs() {
return array(
'dir' => $this->getDir(),
- 'lang' => $this->getLanguageCode(),
+ 'lang' => wfBCP47( $this->getLanguageCode() ),
);
}
<title><?php $this->outputTitle(); ?></title>
<?php echo $this->getCssUrl() . "\n"; ?>
<?php echo $this->getJQuery() . "\n"; ?>
- <?php echo Html::linkedScript( '../skins/common/config.js' ) . "\n"; ?>
+ <?php echo Html::linkedScript( 'config.js' ) . "\n"; ?>
</head>
<?php echo Html::openElement( 'body', array( 'class' => $this->getDir() ) ) . "\n"; ?>
<div id="mw-page-base"></div>
<div id="mw-head-base"></div>
-<div id="content">
-<div id="bodyContent">
+<div id="content" class="mw-body">
+<div id="bodyContent" class="mw-body-content">
<h1><?php $this->outputTitle(); ?></h1>
<?php
<div id="mw-panel">
<div class="portal" id="p-logo">
- <a style="background-image: url(../skins/common/images/mediawiki.png);"
+ <a style="background-image: url(images/installer-logo.png);"
href="https://www.mediawiki.org/"
title="Main Page"></a>
</div>
<title><?php $this->outputTitle(); ?></title>
<?php echo $this->getCssUrl() . "\n"; ?>
<?php echo $this->getJQuery(); ?>
- <?php echo Html::linkedScript( '../skins/common/config.js' ); ?>
+ <?php echo Html::linkedScript( 'config.js' ); ?>
</head>
<body style="background-image: none">