From: Trevor Parscal Date: Tue, 7 Dec 2010 21:45:06 +0000 (+0000) Subject: Improves on r77693 by ensuring site styles are loaded just before user styles. X-Git-Tag: 1.31.0-rc.0~33458 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=26c96c14334ed89b6cf2016ab71f093ef52a7a7c;p=lhc%2Fweb%2Fwiklou.git Improves on r77693 by ensuring site styles are loaded just before user styles. --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 19d0a7f572..4530c1c245 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2588,15 +2588,19 @@ class OutputPage { } } - // Split the styles into two groups, not user (0) and user (1) - $styles = array( array(), array() ); + // Split the styles into three groups + $styles = array( 'other' => array(), 'user' => array(), 'site' => array() ); $resourceLoader = $this->getResourceLoader(); foreach ( $this->getModuleStyles() as $name ) { - $styles[$resourceLoader->getModule( $name )->getGroup() === 'user' ? 1 : 0][] = $name; + $group = $resourceLoader->getModule( $name )->getGroup(); + // Modules in groups named "other" or anything different than "user" or "site" will + // be placed in the "other" group + $styles[isset( $style[$group] ) ? $group : 'other'][] = $name; } // Add styles to tags, user modules last - $tags[] = $this->makeResourceLoaderLink( $sk, $styles[0], 'styles' ); - $tags[] = $this->makeResourceLoaderLink( $sk, $styles[1], 'styles' ); + $tags[] = $this->makeResourceLoaderLink( + $sk, array_merge( $styles['other'], $styles['site'], $styles['user'] ), 'styles' + ); return implode( "\n", $tags ); }