From 0393265003470ef9cce8478084abf533a962016d Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Sat, 4 Dec 2010 00:48:37 +0000 Subject: [PATCH] Fixes r77696 where a few mistakes were made. Also improves on r77693 by using actual group names rather than trying to divine the group from the module name... --- includes/OutputPage.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index ddea5c263c..19d0a7f572 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2436,11 +2436,10 @@ class OutputPage { // Modules requests - let the client calculate dependencies and batch requests as it likes if ( $this->getModules() ) { - $modules = FormatJson::encode( ); $scripts .= Html::inlineScript( ResourceLoader::makeLoaderConditionalScript( - Xml::encodeJsCall( 'mediaWiki.loader.load', $this->getModules() ) . - Xml::encodeJsCall( 'mediaWiki.loader.go' ) + Xml::encodeJsCall( 'mediaWiki.loader.load', array( $this->getModules() ) ) . + Xml::encodeJsCall( 'mediaWiki.loader.go', array() ) ) ) . "\n"; } @@ -2588,15 +2587,16 @@ class OutputPage { } } } - - // Add styles to tags, pushing user modules to the end + + // Split the styles into two groups, not user (0) and user (1) $styles = array( array(), array() ); - foreach ( $this->getModuleStyles() as $module ) { - $styles[strpos( 'user', $module ) === 0 ? 1 : 0][] = $module; + $resourceLoader = $this->getResourceLoader(); + foreach ( $this->getModuleStyles() as $name ) { + $styles[$resourceLoader->getModule( $name )->getGroup() === 'user' ? 1 : 0][] = $name; } + // Add styles to tags, user modules last $tags[] = $this->makeResourceLoaderLink( $sk, $styles[0], 'styles' ); $tags[] = $this->makeResourceLoaderLink( $sk, $styles[1], 'styles' ); - return implode( "\n", $tags ); } -- 2.20.1