Index: trunk/extensions/TreeAndMenu/TreeAndMenu.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | |
16 | 16 | if ( !defined( 'MEDIAWIKI' ) ) die( 'Not an entry point.' ); |
17 | 17 | |
18 | | -define( 'TREEANDMENU_VERSION','1.2.0, 2011-07-08' ); |
| 18 | +define( 'TREEANDMENU_VERSION','1.2.1, 2011-07-08' ); |
19 | 19 | |
20 | 20 | # Set any unset images to default titles |
21 | 21 | if ( !isset( $wgTreeViewImages ) || !is_array( $wgTreeViewImages ) ) $wgTreeViewImages = array(); |
— | — | @@ -264,7 +264,11 @@ |
265 | 265 | $text = preg_replace( "/\x7f1$u\x7f.+?[\\r\\n]+/m", '', $text ); # Remove all unreplaced row information |
266 | 266 | |
267 | 267 | # Add the dTRee script if not loaded yet |
268 | | - if( !$this->js++ ) $wgOut->addHtml( "<script type=\"$wgJsMimeType\" src=\"{$this->baseUrl}/dtree.js\"></script>" ); |
| 268 | + if( !$this->js++ ) { |
| 269 | + $script = "<script type=\"$wgJsMimeType\" src=\"{$this->baseUrl}/dtree.js\"></script>"; |
| 270 | + if( method_exists( $wgOut, 'addModules' ) ) $wgOut->addScript( $script ); |
| 271 | + else $wgOut->addHtml( $script ); |
| 272 | + } |
269 | 273 | return true; |
270 | 274 | } |
271 | 275 | |