34use Wikimedia\Mime\MimeAnalyzer;
54 MimeAnalyzer $mimeAnalyzer,
59 parent::__construct(
'Newimages' );
60 $this->groupPermissionsLookup = $groupPermissionsLookup;
61 $this->dbProvider = $dbProvider;
62 $this->mediaTypes = $mimeAnalyzer->getMediaTypes();
63 $this->linkBatchFactory = $linkBatchFactory;
79 $opts->
add(
'hidepatrolled',
false );
80 $opts->
add(
'mediatype', $this->mediaTypes );
88 if ( $par !==
null ) {
96 if ( $start !==
'' && $end !==
'' && $start > $end ) {
106 $request = $context->getRequest();
109 [
'start' => $start,
'end' => $end ] + $request->getValues(),
110 $request->wasPosted()
121 if ( !array_diff( $this->mediaTypes,
$mediaTypes ) ) {
137 $this->groupPermissionsLookup,
138 $this->linkBatchFactory,
144 $out->addHTML( $pager->getBody() );
146 $out->addHTML( $pager->getNavigationBar() );
151 $mediaTypesText = array_map(
function ( $type ) {
158 return $this->
msg(
'mediastatistics-header-' . strtolower( $type ) )->escaped();
160 $mediaTypesOptions = array_combine( $mediaTypesText, $this->mediaTypes );
161 ksort( $mediaTypesOptions );
165 'class' => HTMLUserTextField::class,
166 'label-message' =>
'newimages-user',
172 'label-message' =>
'newimages-showbots',
173 'name' =>
'showbots',
178 'label-message' =>
'newimages-hidepatrolled',
179 'name' =>
'hidepatrolled',
183 'type' =>
'multiselect',
185 'name' =>
'mediatype',
186 'label-message' =>
'newimages-mediatype',
187 'options' => $mediaTypesOptions,
193 'default' => $this->opts->getValue(
'limit' ),
199 'default' => $this->opts->getValue(
'offset' ),
205 'label-message' =>
'date-range-from',
211 'label-message' =>
'date-range-to',
216 if ( !$this->
getUser()->useFilePatrol() ) {
217 unset( $formDescriptor[
'hidepatrolled'] );
220 HTMLForm::factory(
'ooui', $formDescriptor, $context )
222 ->setFormIdentifier(
'specialnewimages' )
223 ->setWrapperLegendMsg(
'newimages-legend' )
224 ->setSubmitTextMsg(
'ilsubmit' )
227 ->displayForm(
false );
238 $message = $this->
msg(
'newimagestext' )->inContentLanguage();
239 if ( !$message->isDisabled() ) {
241 $this->
getOutput()->addWikiTextAsContent(
242 Html::rawElement(
'div',
244 'lang' => $contLang->getHtmlCode(),
245 'dir' => $contLang->getDir()
247 "\n" . $message->plain() .
"\n"
258class_alias( SpecialNewFiles::class,
'SpecialNewFiles' );
An IContextSource implementation which will inherit context from another source but allow individual ...
Implements a text input field for user names.
Shortcut to construct an includable special page.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
getContext()
Gets the context this SpecialPage is executed in.
getRequest()
Get the WebRequest being used for this instance.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
getContentLanguage()
Shortcut to get content language.
including( $x=null)
Whether the special page is being evaluated via transclusion.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages By default the message key is the canonical name of...
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Interface for objects which can provide a MediaWiki context on request.