* These will be applied to various media & IE conditionals.
*/
public function buildCssLinks() {
+ return implode( "\n", $this->buildCssLinksArray() );
+ }
+
+ public function buildCssLinksArray() {
$links = array();
foreach( $this->styles as $file => $options ) {
$link = $this->styleLink( $file, $options );
if( $link ) {
- $links[] = $link;
+ $links[$file] = $link;
}
}
-
- return implode( "\n", $links );
+ return $links;
}
/**
$titleObj->getPrefixedText();
}
+ if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) {
+ $out = new OutputPage;
+ $out->addParserOutputNoText( $p_result );
+ $userSkin = $wgUser->getSkin();
+ }
+
if ( isset( $prop['headitems'] ) ) {
- $result_array['headitems'] = $this->formatHeadItems( $p_result->getHeadItems() );
+ $headItems = $this->formatHeadItems( $p_result->getHeadItems() );
+
+ $userSkin->setupUserCss( $out );
+ $css = $this->formatCss( $out->buildCssLinksArray() );
+
+ $scripts = array( $out->getHeadScripts( $userSkin ) );
+
+ $result_array['headitems'] = array_merge( $headItems , $css, $scripts );
}
if ( isset( $prop['headhtml'] ) ) {
- $out = new OutputPage;
- $out->addParserOutputNoText( $p_result );
$result_array['headhtml'] = array();
- $result->setContent( $result_array['headhtml'], $out->headElement( $wgUser->getSkin() ) );
+ $result->setContent( $result_array['headhtml'], $out->headElement( $userSkin ) );
}
if ( !is_null( $oldid ) ) {
'images' => 'img',
'externallinks' => 'el',
'sections' => 's',
- 'headitems' => 'hi'
+ 'headitems' => 'hi',
);
$this->setIndexedTagNames( $result_array, $result_mapping );
$result->addValue( null, $this->getModuleName(), $result_array );
return $result;
}
+ private function formatCss( $css ) {
+ $result = array();
+ foreach ( $css as $file => $link ) {
+ $entry = array();
+ $entry['file'] = $file;
+ $this->getResult()->setContent( $entry, $link );
+ $result[] = $entry;
+ }
+ return $result;
+ }
+
private function setIndexedTagNames( &$array, $mapping ) {
foreach ( $mapping as $key => $name ) {
if ( isset( $array[$key] ) ) {