summaryrefslogtreecommitdiff
path: root/includes/resourceloader/ResourceLoaderWikiModule.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
commit63601400e476c6cf43d985f3e7b9864681695ed4 (patch)
treef7846203a952e38aaf66989d0a4702779f549962 /includes/resourceloader/ResourceLoaderWikiModule.php
parent8ff01378c9e0207f9169b81966a51def645b6a51 (diff)
Update to MediaWiki 1.20.2
this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'includes/resourceloader/ResourceLoaderWikiModule.php')
-rw-r--r--includes/resourceloader/ResourceLoaderWikiModule.php19
1 files changed, 7 insertions, 12 deletions
diff --git a/includes/resourceloader/ResourceLoaderWikiModule.php b/includes/resourceloader/ResourceLoaderWikiModule.php
index 91a51f89..ee8dd1e5 100644
--- a/includes/resourceloader/ResourceLoaderWikiModule.php
+++ b/includes/resourceloader/ResourceLoaderWikiModule.php
@@ -1,5 +1,7 @@
<?php
/**
+ * Abstraction for resource loader modules which pull from wiki pages.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -20,8 +22,6 @@
* @author Roan Kattouw
*/
-defined( 'MEDIAWIKI' ) || die( 1 );
-
/**
* Abstraction for resource loader modules which pull from wiki pages
*
@@ -42,7 +42,6 @@ abstract class ResourceLoaderWikiModule extends ResourceLoaderModule {
/* Abstract Protected Methods */
/**
- * @abstract
* @param $context ResourceLoaderContext
*/
abstract protected function getPages( ResourceLoaderContext $context );
@@ -69,14 +68,10 @@ abstract class ResourceLoaderWikiModule extends ResourceLoaderModule {
* @return null|string
*/
protected function getContent( $title ) {
- if ( $title->getNamespace() === NS_MEDIAWIKI ) {
- $message = wfMessage( $title->getDBkey() )->inContentLanguage();
- return $message->exists() ? $message->plain() : '';
- }
if ( !$title->isCssJsSubpage() && !$title->isCssOrJsPage() ) {
return null;
}
- $revision = Revision::newFromTitle( $title );
+ $revision = Revision::newFromTitle( $title, false, Revision::READ_NORMAL );
if ( !$revision ) {
return null;
}
@@ -137,12 +132,12 @@ abstract class ResourceLoaderWikiModule extends ResourceLoaderModule {
}
$style = CSSMin::remap( $style, false, $wgScriptPath, true );
if ( !isset( $styles[$media] ) ) {
- $styles[$media] = '';
+ $styles[$media] = array();
}
if ( strpos( $titleText, '*/' ) === false ) {
- $styles[$media] .= "/* $titleText */\n";
+ $style = "/* $titleText */\n" . $style;
}
- $styles[$media] .= $style . "\n";
+ $styles[$media][] = $style;
}
return $styles;
}
@@ -181,7 +176,7 @@ abstract class ResourceLoaderWikiModule extends ResourceLoaderModule {
// We're dealing with a subclass that doesn't have a DB
return array();
}
-
+
$hash = $context->getHash();
if ( isset( $this->titleMtimes[$hash] ) ) {
return $this->titleMtimes[$hash];