]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/specials/SpecialMIMEsearch.php
MediaWiki 1.14.0
[autoinstallsdev/mediawiki.git] / includes / specials / SpecialMIMEsearch.php
similarity index 87%
rename from includes/SpecialMIMEsearch.php
rename to includes/specials/SpecialMIMEsearch.php
index c89c1af62e87ef8634006186c8e3f75b30fc26a0..cdfde24ea58ccb7fc86f487974ce0c48e8867b9b 100644 (file)
@@ -3,7 +3,8 @@
  * 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
@@ -12,7 +13,7 @@
 /**
  * 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;
@@ -45,7 +46,7 @@ class MIMEsearchPage extends QueryPage {
 
                return
                        "SELECT 'MIMEsearch' AS type,
-                               " . NS_IMAGE . " AS namespace,
+                               " . NS_FILE . " AS namespace,
                                img_name AS title,
                                img_major_mime AS value,
 
@@ -87,15 +88,12 @@ function wfSpecialMIMEsearch( $par = null ) {
        $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' )
        );
 
@@ -113,7 +111,7 @@ function wfSpecialMIMEsearchParse( $str ) {
        if( strpos( $str, '/' ) === false) {
                return array ('', '');
        }
-       
+
        list( $major, $minor ) = explode( '/', $str, 2 );
 
        return array(
@@ -138,4 +136,3 @@ function wfSpecialMIMEsearchValidType( $type ) {
 
        return in_array( $type, $types );
 }
-