mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/InputBox
synced 2024-11-15 03:04:52 +00:00
f1611c78bf
* 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
35 lines
642 B
PHP
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();
|
|
}
|
|
}
|