Index: trunk/extensions/WikiEditor/WikiEditor.php |
— | — | @@ -56,6 +56,7 @@ |
57 | 57 | $wgHooks['EditPage::showEditForm:initial'][] = 'WikiEditorHooks::editPageShowEditFormInitial'; |
58 | 58 | $wgHooks['GetPreferences'][] = 'WikiEditorHooks::getPreferences'; |
59 | 59 | $wgHooks['ResourceLoaderGetConfigVars'][] = 'WikiEditorHooks::resourceLoaderGetConfigVars'; |
| 60 | +$wgHooks['MakeGlobalVariablesScript'][] = 'WikiEditorHooks::makeGlobalVariablesScript'; |
60 | 61 | |
61 | 62 | $wikiEditorTpl = array( |
62 | 63 | 'localBasePath' => dirname( __FILE__ ) . '/modules', |
Index: trunk/extensions/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -244,4 +244,17 @@ |
245 | 245 | } |
246 | 246 | return true; |
247 | 247 | } |
| 248 | + |
| 249 | + public static function makeGlobalVariablesScript( &$vars ) { |
| 250 | + global $wgWikiEditorFeatures; |
| 251 | + |
| 252 | + // Build and export old-style wgWikiEditorEnabledModules object for back compat |
| 253 | + $enabledModules = array(); |
| 254 | + foreach ( self::$features as $name => $feature ) { |
| 255 | + $enabledModules[$name] = self::isEnabled( $name ); |
| 256 | + } |
| 257 | + |
| 258 | + $vars['wgWikiEditorEnabledModules'] = $enabledModules; |
| 259 | + return true; |
| 260 | + } |
248 | 261 | } |
Index: trunk/extensions/Vector/Vector.php |
— | — | @@ -59,6 +59,7 @@ |
60 | 60 | $wgHooks['BeforePageDisplay'][] = 'VectorHooks::beforePageDisplay'; |
61 | 61 | $wgHooks['GetPreferences'][] = 'VectorHooks::getPreferences'; |
62 | 62 | $wgHooks['ResourceLoaderGetConfigVars'][] = 'VectorHooks::resourceLoaderGetConfigVars'; |
| 63 | +$wgHooks['MakeGlobalVariablesScript'][] = 'VectorHooks::makeGlobalVariablesScript'; |
63 | 64 | |
64 | 65 | $vectorResourceTemplate = array( |
65 | 66 | 'localBasePath' => dirname( __FILE__ ) . '/modules', |
Index: trunk/extensions/Vector/Vector.hooks.php |
— | — | @@ -174,4 +174,17 @@ |
175 | 175 | } |
176 | 176 | return true; |
177 | 177 | } |
| 178 | + |
| 179 | + public static function makeGlobalVariablesScript( &$vars ) { |
| 180 | + global $wgVectorFeatures; |
| 181 | + |
| 182 | + // Build and export old-style wgVectorEnabledModules object for back compat |
| 183 | + $enabledModules = array(); |
| 184 | + foreach ( self::$features as $name => $feature ) { |
| 185 | + $enabledModules[$name] = self::isEnabled( $name ); |
| 186 | + } |
| 187 | + |
| 188 | + $vars['wgVectorEnabledModules'] = $enabledModules; |
| 189 | + return true; |
| 190 | + } |
178 | 191 | } |