function acMakeBox()

in extensions/CreateBox/CreateBox.php [96:129]


function acMakeBox( $input, $argv, $parser ) {
	global $wgRequest, $wgScript;
	if( $wgRequest->getVal( 'action' ) == 'create' ) {
		$prefix = acGetOption( $input, 'prefix' );
		$preload = acGetOption( $input, 'preload' );
		$editintro = acGetOption( $input, 'editintro' ); 
		$text = $parser->getTitle()->getPrefixedText();
		if( $prefix && strpos( $text, $prefix ) === 0 ) {
			$text = substr( $text, strlen( $prefix ) );
		}
	} else {
		$prefix = acGetOption( $input, 'prefix' );
		$preload = acGetOption( $input, 'preload' );
		$editintro = acGetOption( $input, 'editintro' );
		$text = acGetOption( $input, 'default' );
	}
	$submit = htmlspecialchars( $wgScript );
	$width = acGetOption( $input, 'width', 0 );
	$align = acGetOption( $input, 'align', 'center' );
	$br = ( ( acGetOption( $input, 'break', 'no' ) == 'no' ) ? '' : '<br />' );
	$label = acGetOption( $input, 'buttonlabel', wfMsgHtml( 'createbox-create' ) );
	$output = <<<ENDFORM
<div class="createbox" align="{$align}">
<form name="createbox" action="{$submit}" method="get" class="createboxForm">
<input type='hidden' name="action" value="create">
<input type="hidden" name="prefix" value="{$prefix}" />
<input type="hidden" name="preload" value="{$preload}" />
<input type="hidden" name="editintro" value="{$editintro}" />
<input class="createboxInput" name="title" type="text" value="{$text}" size="{$width}"/>{$br}
<input type='submit' name="create" class="createboxButton" value="{$label}"/>
</form></div>
ENDFORM;
	return $parser->replaceVariables( $output );
}