X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMIMEsearch.php;h=60225ea5093cf9a2fe1d5ed226f586f41623db65;hb=1fced11531a1a457ccffbd39e423c8536ec44805;hp=4d9e7dad7f6550761782ad2509227a1b90d8924c;hpb=027731f57f6c8dc45c1cef9cd5d2a8d8b7981746;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMIMEsearch.php b/includes/specials/SpecialMIMEsearch.php index 4d9e7dad7f..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 ); @@ -99,39 +99,42 @@ class MIMEsearchPage extends QueryPage { * that this report gives results in a logical order). As an aditional * note, mysql seems to by default order things by img_name ASC, which * is what we ideally want, so everything works out fine anyhow. + * @return array */ function getOrderFields() { return array(); } - function execute( $par ) { - global $wgScript; - - $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' => $wgScript ) + 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; } @@ -185,7 +188,8 @@ class MIMEsearchPage extends QueryPage { 'video', 'message', 'model', - 'multipart' + 'multipart', + 'chemical' ); return in_array( $type, $types );