http://www.mediawiki.org/wiki/Special:Code/MediaWiki/76265
Revision: 76265
Author: mkroetzsch
Date: 2010-11-07 20:06:02 +0000 (Sun, 07 Nov 2010)
Log Message:
-----------
Improve ResourceLoader compatibility for extensions that use SMW's existing (MW
<= 1.16) resource loading mechanism: to become compatible with MW 1.17,
extensions should:
(1) register their own resource loader modules as done for SMW in
./SMW.hooks.php,
(2) continue to use srfRequireHeadItem() but changing the IDs used there for
resources (first parameter) to match the IDs of the resource loader modules
created in step (1).
Modified Paths:
--------------
trunk/extensions/SemanticMediaWiki/includes/SMW_Outputs.php
Modified: trunk/extensions/SemanticMediaWiki/includes/SMW_Outputs.php
===================================================================
--- trunk/extensions/SemanticMediaWiki/includes/SMW_Outputs.php 2010-11-07
19:47:38 UTC (rev 76264)
+++ trunk/extensions/SemanticMediaWiki/includes/SMW_Outputs.php 2010-11-07
20:06:02 UTC (rev 76265)
@@ -59,9 +59,7 @@
return self::requireHeadItemOld( $id, $item );
}
- if ( is_numeric( $id ) ) {
- global $wgOut;
-
+ if ( is_numeric( $id ) ) { // compatibility with older
extensions; eventually the numeric constants should vanish
switch ( $id ) {
case SMW_HEADER_TOOLTIP:
self::requireResource(
'ext.smw.tooltips' );
@@ -74,9 +72,8 @@
break;
}
}
- else {
- // This should not be used anymore; use the RL directly.
- self::$mHeadItems[$id] = $item;
+ else { // normal case: treat ID as a ResourceLoader ID
+ self::requireResource( $id );
}
}
@@ -217,4 +214,4 @@
self::$mHeadItems = array();
}
-}
\ No newline at end of file
+}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs