From ca8cd0a032a3addf9aacf748ddcda1b660269ee8 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 18 Jul 2009 14:24:24 +0000 Subject: [PATCH] fixes for r53282: * readded Skin::getHeadScript() comment * removed pass-by-ref for $out, not needed * removed "implode ( "\n\t", $r )", since $r is no more used * updated SkinStandard::getHeadScript() to have the same parameters --- includes/Skin.php | 14 +++++++++----- skins/Standard.php | 8 ++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index fbe880de35..6440bf038e 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -449,17 +449,21 @@ class Skin extends Linker { return self::makeVariablesScript( $vars ); } /** - * Returns the Head Scripts (from local skin context) + * Return a random selection of the scripts we want in the header, + * according to no particular rhyme or reason. Various other scripts are + * returned from a haphazard assortment of other functions scattered over + * various files. This entire hackish system needs to be burned to the + * ground and rebuilt. * - * local $out variable that should be the same as $wgOut + * @param $out OutputPage object, should be $wgOut * * @return string Raw HTML to output to */ - function getHeadScripts( OutputPage &$out ) { + function getHeadScripts( OutputPage $out ) { global $wgStylePath, $wgUser, $wgJsMimeType, $wgStyleVersion, $wgOut; global $wgUseSiteJs; - $vars = self::makeGlobalVariablesScript( array( 'skinname' => $this->getSkinName() ) ); + $vars = self::makeGlobalVariablesScript( $this->getSkinName() ); //moved wikibits to be called earlier on //$out->addScriptFile( "{$wgStylePath}/common/wikibits.js" ); @@ -478,7 +482,7 @@ class Skin extends Linker { 'action=raw&ctype='.$wgJsMimeType ); $wgOut->addScriptFile( $userjs ); } - return $vars . "\t" . implode ( "\n\t", $r ) . $out->mScripts; + return "\t" . $vars . "\t" . $out->mScripts; } /** diff --git a/skins/Standard.php b/skins/Standard.php index 57c9864011..32455eddf0 100644 --- a/skins/Standard.php +++ b/skins/Standard.php @@ -18,12 +18,12 @@ class SkinStandard extends Skin { /** * */ - function getHeadScripts( $allowUserJs, $extraHtml = '' ) { - global $wgStylePath, $wgJsMimeType, $wgStyleVersion, $wgOut; + function getHeadScripts( OutputPage $out ) { + global $wgStylePath, $wgJsMimeType, $wgStyleVersion; - $s = parent::getHeadScripts( $allowUserJs, $extraHtml ); + $s = parent::getHeadScripts( $out ); if ( 3 == $this->qbSetting() ) { # Floating left - $wgOut->addScriptFile ( "{$wgStylePath}/common/sticky.js" ); + $out->addScriptFile ( "{$wgStylePath}/common/sticky.js" ); } return $s; } -- 2.20.1