X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMIMEsearch.php;h=60225ea5093cf9a2fe1d5ed226f586f41623db65;hb=1fced11531a1a457ccffbd39e423c8536ec44805;hp=5bd69e01a8b8d4ff974307a8dc293bde88ec341e;hpb=130de7345931765e322d9ae0943be7980abf5668;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMIMEsearch.php b/includes/specials/SpecialMIMEsearch.php index 5bd69e01a8..60225ea509 100644 --- a/includes/specials/SpecialMIMEsearch.php +++ b/includes/specials/SpecialMIMEsearch.php @@ -28,7 +28,7 @@ * @ingroup SpecialPage */ class MIMEsearchPage extends QueryPage { - protected $major, $minor; + protected $major, $minor, $mime; function __construct( $name = 'MIMEsearch' ) { parent::__construct( $name ); @@ -105,32 +105,36 @@ class MIMEsearchPage extends QueryPage { return array(); } - function execute( $par ) { - $mime = $par ? $par : $this->getRequest()->getText( 'mime' ); - $mime = trim( $mime ); + /** + * Return HTML to put just before the results. + */ + function getPageHeader() { - $this->setHeaders(); - $this->outputHeader(); - $this->getOutput()->addHTML( - Xml::openElement( + return Xml::openElement( 'form', array( '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, $mime ) . - ' ' . - Xml::submitButton( $this->msg( 'ilsubmit' )->text() ) . - Xml::closeElement( 'fieldset' ) . - Xml::closeElement( 'form' ) - ); + 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' ); + } - list( $this->major, $this->minor ) = File::splitMime( $mime ); + function execute( $par ) { + $this->mime = $par ? $par : $this->getRequest()->getText( 'mime' ); + $this->mime = trim( $this->mime ); + list( $this->major, $this->minor ) = File::splitMime( $this->mime ); if ( $this->major == '' || $this->minor == '' || $this->minor == 'unknown' || !self::isValidType( $this->major ) ) { + $this->setHeaders(); + $this->outputHeader(); + $this->getOutput()->addHTML( $this->getPageHeader() ); return; }