Index: branches/Gadgets-work/Gadgets_body.php |
— | — | @@ -118,7 +118,6 @@ |
119 | 119 | |
120 | 120 | $lb->execute( __METHOD__ ); |
121 | 121 | |
122 | | - $pages = array(); |
123 | 122 | $done = array(); |
124 | 123 | foreach ( $pages as $page ) { |
125 | 124 | if ( isset( $done[$page] ) ) continue; |
— | — | @@ -208,11 +207,17 @@ |
209 | 208 | } |
210 | 209 | |
211 | 210 | public function getModule() { |
212 | | - $pages = $this->styles; |
| 211 | + $pages = array(); |
| 212 | + foreach( $this->styles as $style ) { |
| 213 | + $pages[$style] = array( 'ns' => NS_MEDIAWIKI, 'type' => 'style' ); |
| 214 | + } |
213 | 215 | if ( $this->supportsResourceLoader() ) { |
214 | | - $pages += $this->scripts; |
| 216 | + foreach ( $this->scripts as $script ) { |
| 217 | + $pages[$script] = array( 'ns' => NS_MEDIAWIKI, 'type' => 'script' ); |
| 218 | + } |
215 | 219 | } |
216 | | - if ( count( $pages ) ) { |
| 220 | + if ( !count( $pages ) ) { |
| 221 | + return null; |
217 | 222 | } |
218 | 223 | return new GadgetResourceLoaderModule( $pages ); |
219 | 224 | } |