Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/214424
Change subject: Move function from Resources.php to Hooks.php ...................................................................... Move function from Resources.php to Hooks.php Moves ResourceLoaderRegisterModules function to Hooks.php in preparation for extension.json. Change-Id: I5c168b4f13d763064cfa8c2fa71bbbeb9a785e7a (cherry picked from commit 8f0ebd655882fd1d773e1a9cb1645bdd90439b86) --- M Flow.php M Hooks.php M Resources.php 3 files changed, 21 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/24/214424/1 diff --git a/Flow.php b/Flow.php index e66bd23..4dc9e4d 100644 --- a/Flow.php +++ b/Flow.php @@ -77,6 +77,8 @@ $dir = __DIR__ . '/'; require $dir . 'Resources.php'; +$wgHooks['ResourceLoaderRegisterModules'][] = 'FlowHooks::onResourceLoaderRegisterModules'; + $wgMessagesDirs['Flow'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['Flow'] = $dir . 'Flow.i18n.php'; $wgExtensionMessagesFiles['FlowNamespaces'] = $dir . '/Flow.namespaces.php'; diff --git a/Hooks.php b/Hooks.php index 8151b58..6360b8a 100644 --- a/Hooks.php +++ b/Hooks.php @@ -22,6 +22,25 @@ */ protected static $abuseFilter; + public static function onResourceLoaderRegisterModules( ResourceLoader &$resourceLoader ) { + global $wgFlowEventLogging, $wgResourceModules; + + // Only if EventLogging in Flow is enabled & EventLogging exists + if ( $wgFlowEventLogging && class_exists( 'ResourceLoaderSchemaModule' ) ) { + $resourceLoader->register( 'schema.FlowReplies', array( + 'class' => 'ResourceLoaderSchemaModule', + 'schema' => 'FlowReplies', + // See https://meta.wikimedia.org/wiki/Schema:FlowReplies, below title + 'revision' => 10561344, + ) ); + + // Add as dependency to Flow JS + $wgResourceModules['ext.flow']['dependencies'][] = 'schema.FlowReplies'; + } + + return true; + } + /** * Initialized during extension initialization rather than * in container so that non-flow pages don't load the container. diff --git a/Resources.php b/Resources.php index 67637fb..3482521 100644 --- a/Resources.php +++ b/Resources.php @@ -527,22 +527,3 @@ ), ) + $mobile, ); - -$wgHooks['ResourceLoaderRegisterModules'][] = function ( ResourceLoader &$resourceLoader ) { - global $wgFlowEventLogging, $wgResourceModules; - - // Only if EventLogging in Flow is enabled & EventLogging exists - if ( $wgFlowEventLogging && class_exists( 'ResourceLoaderSchemaModule' ) ) { - $resourceLoader->register( 'schema.FlowReplies', array( - 'class' => 'ResourceLoaderSchemaModule', - 'schema' => 'FlowReplies', - // See https://meta.wikimedia.org/wiki/Schema:FlowReplies, below title - 'revision' => 10561344, - ) ); - - // Add as dependency to Flow JS - $wgResourceModules['ext.flow']['dependencies'][] = 'schema.FlowReplies'; - } - - return true; -}; -- To view, visit https://gerrit.wikimedia.org/r/214424 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c168b4f13d763064cfa8c2fa71bbbeb9a785e7a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: REL1_25 Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits