mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/InputBox
synced 2024-11-15 11:13:27 +00:00
37 lines
655 B
PHP
37 lines
655 B
PHP
<?php
|
|
/**
|
|
* Hooks for InputBox extension
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
*/
|
|
|
|
// InputBox hooks
|
|
class InputBoxHooks {
|
|
|
|
/* Functions */
|
|
|
|
// Initialization
|
|
public static function register() {
|
|
global $wgParser;
|
|
|
|
// Register the hook with the parser
|
|
$wgParser->setHook( 'inputbox', array( 'InputBoxHooks', 'render' ) );
|
|
|
|
// Continue
|
|
return true;
|
|
}
|
|
|
|
// Render the input box
|
|
public static function render( $input, $args, $parser ) {
|
|
// Create InputBox
|
|
$inputBox = new InputBox( $parser );
|
|
|
|
// Configure InputBox
|
|
$inputBox->extractOptions( $parser->replaceVariables( $input ) );
|
|
|
|
// Return output
|
|
return $inputBox->render();
|
|
}
|
|
}
|