* A special page to search for files by MIME type as defined in the
* img_major_mime and img_minor_mime fields in the image table
*
- * @addtogroup SpecialPage
+ * @file
+ * @ingroup SpecialPage
*
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
/**
* Searches the database for files of the requested MIME type, comparing this with the
* 'img_major_mime' and 'img_minor_mime' fields in the image table.
- * @addtogroup SpecialPage
+ * @ingroup SpecialPage
*/
class MIMEsearchPage extends QueryPage {
var $major, $minor;
return
"SELECT 'MIMEsearch' AS type,
- " . NS_IMAGE . " AS namespace,
+ " . NS_FILE . " AS namespace,
img_name AS title,
img_major_mime AS value,
$mime = isset( $par ) ? $par : $wgRequest->getText( 'mime' );
$wgOut->addHTML(
- Xml::openElement( 'form',
- array(
- 'id' => 'specialmimesearch',
- 'method' => 'get',
- 'action' => $wgTitle->escapeLocalUrl()
- )
- ) .
- Xml::inputLabel( wfMsg( 'mimetype' ), 'mime', 'mime', 20, $mime ) .
- Xml::submitButton( wfMsg( 'ilsubmit' ) ) .
+ Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgTitle->getLocalUrl() ) ) .
+ Xml::openElement( 'fieldset' ) .
+ Xml::element( 'legend', null, wfMsg( 'mimesearch' ) ) .
+ Xml::inputLabel( wfMsg( 'mimetype' ), 'mime', 'mime', 20, $mime ) . ' ' .
+ Xml::submitButton( wfMsg( 'ilsubmit' ) ) .
+ Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' )
);
if( strpos( $str, '/' ) === false) {
return array ('', '');
}
-
+
list( $major, $minor ) = explode( '/', $str, 2 );
return array(
return in_array( $type, $types );
}
-