r53443 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53442‎ | r53443 | r53444 >
Date:14:24, 18 July 2009
Author:ialex
Status:ok
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/skins/Standard.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Standard.php
@@ -18,12 +18,12 @@
1919 /**
2020 *
2121 */
22 - function getHeadScripts( $allowUserJs, $extraHtml = '' ) {
23 - global $wgStylePath, $wgJsMimeType, $wgStyleVersion, $wgOut;
 22+ function getHeadScripts( OutputPage $out ) {
 23+ global $wgStylePath, $wgJsMimeType, $wgStyleVersion;
2424
25 - $s = parent::getHeadScripts( $allowUserJs, $extraHtml );
 25+ $s = parent::getHeadScripts( $out );
2626 if ( 3 == $this->qbSetting() ) { # Floating left
27 - $wgOut->addScriptFile ( "{$wgStylePath}/common/sticky.js" );
 27+ $out->addScriptFile ( "{$wgStylePath}/common/sticky.js" );
2828 }
2929 return $s;
3030 }
Index: trunk/phase3/includes/Skin.php
@@ -449,17 +449,21 @@
450450 return self::makeVariablesScript( $vars );
451451 }
452452 /**
453 - * Returns the Head Scripts (from local skin context)
 453+ * Return a random selection of the scripts we want in the header,
 454+ * according to no particular rhyme or reason. Various other scripts are
 455+ * returned from a haphazard assortment of other functions scattered over
 456+ * various files. This entire hackish system needs to be burned to the
 457+ * ground and rebuilt.
454458 *
455 - * local $out variable that should be the same as $wgOut
 459+ * @param $out OutputPage object, should be $wgOut
456460 *
457461 * @return string Raw HTML to output to <head>
458462 */
459 - function getHeadScripts( OutputPage &$out ) {
 463+ function getHeadScripts( OutputPage $out ) {
460464 global $wgStylePath, $wgUser, $wgJsMimeType, $wgStyleVersion, $wgOut;
461465 global $wgUseSiteJs;
462466
463 - $vars = self::makeGlobalVariablesScript( array( 'skinname' => $this->getSkinName() ) );
 467+ $vars = self::makeGlobalVariablesScript( $this->getSkinName() );
464468
465469 //moved wikibits to be called earlier on
466470 //$out->addScriptFile( "{$wgStylePath}/common/wikibits.js" );
@@ -478,7 +482,7 @@
479483 'action=raw&ctype='.$wgJsMimeType );
480484 $wgOut->addScriptFile( $userjs );
481485 }
482 - return $vars . "\t" . implode ( "\n\t", $r ) . $out->mScripts;
 486+ return "\t" . $vars . "\t" . $out->mScripts;
483487 }
484488
485489 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r53282here it is ... the upload-api, script-server, js2 (javascript phase2) branch ...dale23:52, 14 July 2009

Status & tagging log