Index: trunk/phase3/includes/Skin.php |
— | — | @@ -352,12 +352,15 @@ |
353 | 353 | |
354 | 354 | /** |
355 | 355 | * Make a <script> tag containing global variables |
356 | | - * @param array $data Associative array containing one element: |
357 | | - * skinname => the skin name |
| 356 | + * @param $skinName string Name of the skin |
358 | 357 | * The odd calling convention is for backwards compatibility |
359 | 358 | * @TODO @FIXME Make this not depend on $wgTitle! |
360 | 359 | */ |
361 | | - static function makeGlobalVariablesScript( $data ) { |
| 360 | + static function makeGlobalVariablesScript( $skinName ) { |
| 361 | + if ( is_array( $skinName ) ) { |
| 362 | + # Weird back-compat stuff. |
| 363 | + $skinName = $skinName['skinname']; |
| 364 | + } |
362 | 365 | global $wgScript, $wgTitle, $wgStylePath, $wgUser; |
363 | 366 | global $wgArticlePath, $wgScriptPath, $wgServer, $wgContLang, $wgLang, $wgVariant; |
364 | 367 | global $wgCanonicalNamespaceNames, $wgOut, $wgArticle; |
— | — | @@ -383,7 +386,7 @@ |
384 | 387 | ); |
385 | 388 | |
386 | 389 | $vars = array( |
387 | | - 'skin' => $data['skinname'], |
| 390 | + 'skin' => $skinName, |
388 | 391 | 'stylepath' => $wgStylePath, |
389 | 392 | 'wgArticlePath' => $wgArticlePath, |
390 | 393 | 'wgScriptPath' => $wgScriptPath, |
— | — | @@ -469,7 +472,7 @@ |
470 | 473 | function getHeadScripts( $allowUserJs, $extraHtml = '' ) { |
471 | 474 | global $wgStylePath, $wgUser, $wgJsMimeType, $wgStyleVersion; |
472 | 475 | |
473 | | - $vars = self::makeGlobalVariablesScript( array( 'skinname' => $this->getSkinName() ) ); |
| 476 | + $vars = self::makeGlobalVariablesScript( $this->getSkinName() ); |
474 | 477 | |
475 | 478 | $r = array( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/wikibits.js?$wgStyleVersion\"></script>\n$extraHtml" ); |
476 | 479 | global $wgUseSiteJs; |