r74250 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74249‎ | r74250 | r74251 >
Date:12:39, 4 October 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.7 - added resource loader modules hook
Modified paths:
  • /trunk/extensions/Maps/Maps.hooks.php (modified) (history)
  • /trunk/extensions/Maps/Maps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps.php
@@ -81,6 +81,9 @@
8282
8383 // Since 0.7
8484 $wgHooks['SkinAfterBottomScripts'][] = 'MapsHooks::addOnloadFunction';
 85+
 86+ // Since 0.7
 87+ $wgHooks['ResourceLoaderRegisterModules'][] = 'MapsHooks::registerResourceLoaderModules';
8588 }
8689
8790 /**
Index: trunk/extensions/Maps/Maps.hooks.php
@@ -57,6 +57,30 @@
5858 }
5959
6060 return true;
 61+ }
 62+
 63+ /**
 64+ * Register the resource modules for the resource loader.
 65+ *
 66+ * @since 0.7
 67+ *
 68+ * @param ResourceLoader $resourceLoader
 69+ *
 70+ * @return true
 71+ */
 72+ public static function registerResourceLoaderModules( ResourceLoader &$resourceLoader ) {
 73+ global $smwgScriptPath, $wgContLang;
 74+
 75+ $modules = array(
 76+ );
 77+
 78+ foreach ( $modules as $name => $resources ) {
 79+ $resourceLoader->register( $name, new ResourceLoaderFileModule(
 80+ array_merge_recursive( $resources, array( 'group' => 'ext.maps' ) )
 81+ ) );
 82+ }
 83+
 84+ return true;
6185 }
6286
6387 }
\ No newline at end of file

Status & tagging log