}
/**
- * Return HTML to put just before the results.
+ * Generate and output the form
*/
function getPageHeader() {
- return Xml::openElement(
- 'form',
- [ 'id' => 'specialmimesearch', 'method' => 'get', 'action' => wfScript() ]
- ) .
- Xml::openElement( 'fieldset' ) .
- Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) .
- Xml::element( 'legend', null, $this->msg( 'mimesearch' )->text() ) .
- Xml::inputLabel( $this->msg( 'mimetype' )->text(), 'mime', 'mime', 20, $this->mime ) .
- ' ' .
- Xml::submitButton( $this->msg( 'ilsubmit' )->text() ) .
- Xml::closeElement( 'fieldset' ) .
- Xml::closeElement( 'form' );
+ $formDescriptor = [
+ 'mime' => [
+ 'type' => 'text',
+ 'name' => 'mime',
+ 'label-message' => 'mimetype',
+ 'required' => true,
+ 'default' => $this->mime,
+ ],
+ ];
+
+ $form = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() )
+ ->setWrapperLegendMsg( 'mimesearch' )
+ ->setSubmitTextMsg( 'ilsubmit' )
+ ->setAction( $this->getPageTitle()->getLocalURL() )
+ ->setMethod( 'get' )
+ ->prepareForm()
+ ->displayForm( false );
}
public function execute( $par ) {
) {
$this->setHeaders();
$this->outputHeader();
- $this->getOutput()->addHTML( $this->getPageHeader() );
+ $this->getPageHeader();
return;
}