diff options
Diffstat (limited to 'Widgets/WidgetInitializer.php')
-rw-r--r-- | Widgets/WidgetInitializer.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Widgets/WidgetInitializer.php b/Widgets/WidgetInitializer.php new file mode 100644 index 00000000..233e6ef8 --- /dev/null +++ b/Widgets/WidgetInitializer.php @@ -0,0 +1,22 @@ +<?php +class WidgetInitializer { + + public static function init() { + // Unsetting required namespace permission rights if using FlaggedRevs + global $wgNamespaceProtection, $wgWidgetsUseFlaggedRevs; + if ( $wgWidgetsUseFlaggedRevs ) { + $wgNamespaceProtection[NS_WIDGET] = []; + } + } + + /** + * @param &$parser Parser + * @return bool + */ + public static function initParserFunctions( &$parser ) { + $parser->setFunctionHook( 'widget', 'WidgetRenderer::renderWidget' ); + + return true; + } + +} |