fixes for r53282:
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 18 Jul 2009 14:24:24 +0000 (14:24 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 18 Jul 2009 14:24:24 +0000 (14:24 +0000)
* 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
skins/Standard.php

index fbe880d..6440bf0 100644 (file)
@@ -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 <head>
         */
-       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;
        }
 
        /**
index 57c9864..32455ed 100644 (file)
@@ -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;
        }