diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2012-06-13 23:40:19 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-06-13 23:40:19 +0200 |
commit | 588cc40aeec0165400421ef9612e81b6d2c7b936 (patch) | |
tree | 85f1e86ba187fbc81ef42393433f1fa5aa6defb3 /includes/installer/WebInstallerOutput.php | |
parent | 67674d7a741c7c1de947f30ceb1ab3b35283308e (diff) |
Update to MediaWiki 1.19.1
Diffstat (limited to 'includes/installer/WebInstallerOutput.php')
-rw-r--r-- | includes/installer/WebInstallerOutput.php | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/includes/installer/WebInstallerOutput.php b/includes/installer/WebInstallerOutput.php index ac97b37d..c6c8a4c2 100644 --- a/includes/installer/WebInstallerOutput.php +++ b/includes/installer/WebInstallerOutput.php @@ -94,18 +94,42 @@ class WebInstallerOutput { */ public function getCSS( $dir ) { $skinDir = dirname( dirname( dirname( __FILE__ ) ) ) . '/skins'; - $vectorCssFile = "$skinDir/vector/screen.css"; - $configCssFile = "$skinDir/common/config.css"; + + // All these files will be concatenated in sequence and loaded + // as one file. + // The string 'images/' in the files' contents will be replaced + // by '../skins/$skinName/images/', where $skinName is what appears + // before the last '/' in each of the strings. + $cssFileNames = array( + + // Basically the "skins.vector" ResourceLoader module styles + 'common/commonElements.css', + 'common/commonContent.css', + 'common/commonInterface.css', + 'vector/screen.css', + + // mw-config specific + 'common/config.css', + ); + $css = ''; + wfSuppressWarnings(); - $vectorCss = file_get_contents( $vectorCssFile ); - $configCss = file_get_contents( $configCssFile ); - wfRestoreWarnings(); - if( !$vectorCss || !$configCss ) { - $css = "/** Your webserver cannot read $vectorCssFile or $configCssFile, please check file permissions */"; + foreach ( $cssFileNames as $cssFileName ) { + $fullCssFileName = "$skinDir/$cssFileName"; + $cssFileContents = file_get_contents( $fullCssFileName ); + if ( $cssFileContents ) { + preg_match( "/^(\w+)\//", $cssFileName, $match ); + $skinName = $match[1]; + $css .= str_replace( 'images/', "../skins/$skinName/images/", $cssFileContents ); + } else { + $css .= "/** Your webserver cannot read $fullCssFileName. Please check file permissions. */"; + } + + $css .= "\n"; } + wfRestoreWarnings(); - $css .= str_replace( 'images/', '../skins/vector/images/', $vectorCss ) . "\n" . str_replace( 'images/', '../skins/common/images/', $configCss ); if( $dir == 'rtl' ) { $css = CSSJanus::transform( $css, true ); } |