Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Outputs.php |
— | — | @@ -29,6 +29,9 @@ |
30 | 30 | |
31 | 31 | /// Protected member function for temporarily storing header items. |
32 | 32 | protected static $mHeadItems = array(); |
| 33 | + |
| 34 | + /// Protected member function for temporarily storing resource modules. |
| 35 | + protected static $resourceModules = array(); |
33 | 36 | |
34 | 37 | /** |
35 | 38 | * Adds rousource loader modules or other head items. |
— | — | @@ -50,13 +53,13 @@ |
51 | 54 | |
52 | 55 | switch ( $id ) { |
53 | 56 | case SMW_HEADER_TOOLTIP: |
54 | | - self::$mHeadItems['smw_tt'] = 'ext.smw.tooltips'; |
| 57 | + self::$resourceModules['smw_tt'] = 'ext.smw.tooltips'; |
55 | 58 | break; |
56 | 59 | case SMW_HEADER_SORTTABLE: |
57 | | - self::$mHeadItems['smw_st'] = 'ext.smw.sorttable'; |
| 60 | + self::$resourceModules['smw_st'] = 'ext.smw.sorttable'; |
58 | 61 | break; |
59 | 62 | case SMW_HEADER_STYLE: |
60 | | - self::$mHeadItems['smw_css'] = 'ext.smw.style'; |
| 63 | + self::$resourceModules['smw_css'] = 'ext.smw.style'; |
61 | 64 | break; |
62 | 65 | } |
63 | 66 | } |
— | — | @@ -166,16 +169,16 @@ |
167 | 170 | * @param ParserOutput $parserOutput |
168 | 171 | */ |
169 | 172 | static public function commitToParserOutput( ParserOutput $parserOutput ) { |
| 173 | + foreach ( self::$mHeadItems as $key => $item ) { |
| 174 | + $parserOutput->addHeadItem( "\t\t" . $item . "\n", $key ); |
| 175 | + } |
| 176 | + |
170 | 177 | // Check if the resource loader can be used or not. |
171 | 178 | if ( method_exists( 'OutputPage', 'addModules' ) ) { |
172 | | - $parserOutput->addModules( array_values( self::$mHeadItems ) ); |
| 179 | + $parserOutput->addModules( self::$resourceModules ); |
173 | 180 | } |
174 | | - else { |
175 | | - foreach ( self::$mHeadItems as $key => $item ) { |
176 | | - $parserOutput->addHeadItem( "\t\t" . $item . "\n", $key ); |
177 | | - } |
178 | | - } |
179 | 181 | |
| 182 | + self::$resourceModules = array(); |
180 | 183 | self::$mHeadItems = array(); |
181 | 184 | } |
182 | 185 | |