mediawiki-extensions-InputBox/InputBox.hooks.php
Chad Horohoe f1611c78bf Nuking fallback code for MW < 1.12 in most extensions (there's like 5 or 6 left I haven't done). Couple of points:
* 1.11 and below aren't supported anymore, so we don't need to be maintaining back-compat code for it anymore. This is why we branch extensions
* The vast majority of these were using $wgParser. This defeats the purpose of ParserFirstCallInit...allowing you to use parsers other than $wgParser. All these extensions now work in any instance of the Parser, not just $wgParser
2009-09-04 22:22:12 +00:00

35 lines
642 B
PHP

<?php
/**
* Hooks for InputBox extension
*
* @file
* @ingroup Extensions
*/
// InputBox hooks
class InputBoxHooks {
/* Functions */
// Initialization
public static function register( &$parser ) {
// Register the hook with the parser
$parser->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();
}
}