mediawiki-extensions-InputBox/InputBox.hooks.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();
}
}