From: Roan Kattouw Date: Thu, 23 Dec 2010 23:26:10 +0000 (+0000) Subject: Revert r78023 and its follow-up r78802: change seems to have been made for somewhat... X-Git-Tag: 1.31.0-rc.0~33129 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=a3bc55836750179e63f780020a7f45934b90a742;p=lhc%2Fweb%2Fwiklou.git Revert r78023 and its follow-up r78802: change seems to have been made for somewhat cosmetic reasons ("it makes more sense for this to be here rather than there") and breaks stuff. Will reapply typo fix from r78802 in next commit --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index b9653b1ba5..247e0f0455 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2213,8 +2213,8 @@ class OutputPage { $ret .= Html::element( 'title', null, $this->getHTMLTitle() ) . "\n"; $ret .= implode( "\n", array( - $this->getHeadLinks(), - $this->buildCssLinks( $sk ), + $this->getHeadLinks( $sk ), + $this->buildCssLinks(), $this->getHeadItems(), ) ); if ( $sk->usercss ) { @@ -2499,7 +2499,7 @@ class OutputPage { /** * @return string HTML tag links to be put in the header. */ - public function getHeadLinks() { + public function getHeadLinks( Skin $sk ) { global $wgFeed; // Ideally this should happen earlier, somewhere. :P @@ -2570,6 +2570,19 @@ class OutputPage { } } + // Split the styles into three groups + $styles = array( 'other' => array(), 'user' => array(), 'site' => array() ); + $resourceLoader = $this->getResourceLoader(); + foreach ( $this->getModuleStyles() as $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, array_merge( $styles['other'], $styles['site'], $styles['user'] ), 'styles' + ); return implode( "\n", $tags ); } @@ -2627,23 +2640,8 @@ class OutputPage { * Build a set of s for the stylesheets specified in the $this->styles array. * These will be applied to various media & IE conditionals. */ - public function buildCssLinks( $sk ) { - // Split the styles into three groups - $styles = array( 'other' => array(), 'user' => array(), 'site' => array() ); - $resourceLoader = $this->getResourceLoader(); - foreach ( $this->getModuleStyles() as $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( $styles[$group] ) ? $group : 'other'][] = $name; - } - // Add tags created using legacy methods - $tags = $this->buildCssLinksArray(); - // Add ResourceLoader module style tags - $tags[] = $this->makeResourceLoaderLink( - $sk, array_merge( $styles['other'], $styles['site'], $styles['user'] ), 'styles' - ); - return implode( "\n", $tags ); + public function buildCssLinks() { + return implode( "\n", $this->buildCssLinksArray() ); } public function buildCssLinksArray() {