Merge "Add media type based filtering to Special:NewFiles"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 15 Jun 2017 17:28:35 +0000 (17:28 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 15 Jun 2017 17:28:35 +0000 (17:28 +0000)
1  2 
includes/specials/SpecialNewimages.php
includes/specials/pagers/NewFilesPager.php
languages/i18n/en.json
languages/i18n/qqq.json

@@@ -32,8 -35,11 +35,10 @@@ class SpecialNewFiles extends Includabl
        public function execute( $par ) {
                $this->setHeaders();
                $this->outputHeader();
+               $mimeAnalyzer = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
+               $this->mediaTypes = $mimeAnalyzer->getMediaTypes();
  
                $out = $this->getOutput();
 -              $out->addModules( 'mediawiki.special.newFiles' );
                $this->addHelpLink( 'Help:New images' );
  
                $opts = new FormOptions();
@@@ -41,8 -47,8 +46,9 @@@
                $opts->add( 'like', '' );
                $opts->add( 'user', '' );
                $opts->add( 'showbots', false );
 +              $opts->add( 'newbies', false );
                $opts->add( 'hidepatrolled', false );
+               $opts->add( 'mediatype', $this->mediaTypes );
                $opts->add( 'limit', 50 );
                $opts->add( 'offset', '' );
                $opts->add( 'start', '' );
        "newimages-legend": "Filter",
        "newimages-label": "Filename (or a part of it):",
        "newimages-user": "IP address or username",
 +      "newimages-newbies": "Show contributions of new accounts only",
        "newimages-showbots": "Show uploads by bots",
        "newimages-hidepatrolled": "Hide patrolled uploads",
+       "newimages-mediatype": "Media type:",
        "noimages": "Nothing to see.",
        "gallery-slideshow-toggle": "Toggle thumbnails",
        "ilsubmit": "Search",
        "newimages-legend": "Caption of the fieldset for the filter on [[Special:NewImages]]\n\n{{Identical|Filter}}",
        "newimages-label": "Caption of the filter editbox on [[Special:NewImages]]",
        "newimages-user": "Caption of the username/IP address editbox on [[Special:NewImages]]",
 +      "newimages-newbies": "Used as label for a checkbox. When checked, [[Special:NewImages]] will only display uploads by new users.",
        "newimages-showbots": "Used as label for a checkbox. When checked, [[Special:NewImages]] will also display uploads by users in the bots group.",
        "newimages-hidepatrolled": "Used as label for a checkbox. When checked, [[Special:NewImages]] will not display patrolled uploads.\n\nCf. {{msg-mw|tog-hidepatrolled}} and {{msg-mw|apihelp-feedrecentchanges-param-hidepatrolled}}.",
+       "newimages-mediatype": "Used as label for a multiselect where users can select the media types to display.",
        "noimages": "This is shown on the special page [[Special:NewImages]], when there aren't any recently uploaded files.",
        "gallery-slideshow-toggle": "Tooltip for the icon that toggles thumbnails on a slideshow  gallery.",
        "ilsubmit": "Search button in [[Special:MIMESearch]].\n\nStrings on the page:\n* {{msg-mw|Mimesearch|page title, legend of input form, link in special pages}}\n* {{msg-mw|Mimesearch-summary|page summary}}\n* {{msg-mw|Mimetype|label for input box}}\n* {{msg-mw|Ilsubmit|search button}}\n\nCheck [[mw:Manual:MIME_type_detection]] for MIME types.\n\n{{Identical|Search}}",