http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56444

Revision: 56444
Author:   brion
Date:     2009-09-16 21:31:17 +0000 (Wed, 16 Sep 2009)

Log Message:
-----------
Fix for wikibits.js loading when $wgStylePath != "$wgScriptPath/skins"

Modified Paths:
--------------
    trunk/phase3/includes/OutputPage.php

Modified: trunk/phase3/includes/OutputPage.php
===================================================================
--- trunk/phase3/includes/OutputPage.php        2009-09-16 21:09:08 UTC (rev 
56443)
+++ trunk/phase3/includes/OutputPage.php        2009-09-16 21:31:17 UTC (rev 
56444)
@@ -171,7 +171,7 @@
         * Add the core scripts that are included on every page, for later 
output into the header
         */
        function addCoreScripts2Top(){
-               global $wgEnableScriptLoader, $wgJSAutoloadLocalClasses, 
$wgScriptPath, $wgEnableJS2system;
+               global $wgEnableScriptLoader, $wgJSAutoloadLocalClasses, 
$wgScriptPath, $wgStylePath, $wgEnableJS2system;
                // @todo We should deprecate wikibits in favor of mv_embed and 
jQuery
 
                if( $wgEnableJS2system ){
@@ -186,7 +186,16 @@
                        $so = '';
                        foreach( $core_classes as $s ){
                                if( isset( $wgJSAutoloadLocalClasses[$s] ) ){
-                                       $so .= Html::linkedScript( 
"{$wgScriptPath}/{$wgJSAutoloadLocalClasses[$s]}?" . $this->getURIDparam() );
+                                       $path = $wgJSAutoloadLocalClasses[$s];
+                                       // @fixme this is an awful hack
+                                       if( substr( $path, 0, 4 ) == "http"  || 
substr( $path, 0, 1 ) == '/' ) {
+                                               // Assume a full or local path
+                                       } elseif( substr( $path, 0, 6 ) == 
"skins/" ) {
+                                               $path = $wgStylePath . substr( 
$path, 5 );
+                                       } else {
+                                               $path = $wgScriptPath . "/" . 
$path;
+                                       }
+                                       $so .= Html::linkedScript( $path . "?" 
. $this->getURIDparam() );
                                }
                        }
                        $this->mScripts =  $so . $this->mScripts;



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to