From 268584a99e029d060ca341b006fcbe3b496101ab Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Wed, 24 Sep 2014 21:28:39 -0700 Subject: [PATCH] Merge two $wgExtensionFunctions Change-Id: I8695446ae9f8aea56dcda4a0d6d5787e97d77217 --- MultimediaViewer.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/MultimediaViewer.php b/MultimediaViewer.php index 7d9d7ef1a..060eee658 100644 --- a/MultimediaViewer.php +++ b/MultimediaViewer.php @@ -930,7 +930,8 @@ $wgResourceModules += array( ); $wgExtensionFunctions[] = function () { - global $wgResourceModules, $wgEventLoggingSchemas; + global $wgResourceModules, $wgEventLoggingSchemas, + $wgMediaViewerEnableByDefault, $wgDefaultUserOptions; if ( isset( $wgResourceModules['ext.eventLogging'] ) ) { $wgEventLoggingSchemas[ 'MediaViewer' ] = 9989959; @@ -942,6 +943,11 @@ $wgExtensionFunctions[] = function () { $wgResourceModules['mmv.logging.Performance']['dependencies'][] = 'ext.eventLogging'; $wgResourceModules['mmv.logging.DurationLogger']['dependencies'][] = 'ext.eventLogging'; } + + if ( $wgMediaViewerEnableByDefault ) { + $wgDefaultUserOptions['multimediaviewer-enable'] = true; + } + }; foreach ( array( @@ -969,13 +975,6 @@ foreach ( array( $wgAutoloadClasses['MultimediaViewerHooks'] = __DIR__ . '/MultimediaViewerHooks.php'; -$wgExtensionFunctions[] = function () { - global $wgMediaViewerEnableByDefault, $wgDefaultUserOptions; - if ( $wgMediaViewerEnableByDefault ) { - $wgDefaultUserOptions['multimediaviewer-enable'] = true; - } -}; - $wgHooks['GetPreferences'][] = 'MultimediaViewerHooks::getPreferences'; $wgHooks['GetBetaFeaturePreferences'][] = 'MultimediaViewerHooks::getBetaPreferences'; $wgHooks['BeforePageDisplay'][] = 'MultimediaViewerHooks::getModulesForArticle';