diff options
Diffstat (limited to 'extensions/WikiEditor/WikiEditor.hooks.php')
-rw-r--r-- | extensions/WikiEditor/WikiEditor.hooks.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/extensions/WikiEditor/WikiEditor.hooks.php b/extensions/WikiEditor/WikiEditor.hooks.php index a840dc4b..682f7aa2 100644 --- a/extensions/WikiEditor/WikiEditor.hooks.php +++ b/extensions/WikiEditor/WikiEditor.hooks.php @@ -287,6 +287,8 @@ class WikiEditorHooks { if ( count( $configurations ) ) { $vars = array_merge( $vars, $configurations ); } + //expose magic words for use by the wikieditor toolbar + WikiEditorHooks::getMagicWords( $vars ); return true; } @@ -304,4 +306,27 @@ class WikiEditorHooks { $vars['wgWikiEditorEnabledModules'] = $enabledModules; return true; } + + /** + * Expose useful magic words which are used by the wikieditor toolbar + * @param $vars array + * @return bool + */ + private static function getMagicWords( &$vars ){ + $requiredMagicWords = array( + 'redirect', + 'img_right', + 'img_left', + 'img_none', + 'img_center', + 'img_thumbnail', + 'img_framed', + 'img_frameless', + ); + foreach ( $requiredMagicWords as $name ) { + $magicWords[$name] = MagicWord::get( $name )->getSynonym( 0 ); + } + $vars['wgWikiEditorMagicWords'] = $magicWords; + } + } |