58 MimeAnalyzer $mimeAnalyzer,
63 parent::__construct(
'Newimages' );
64 $this->groupPermissionsLookup = $groupPermissionsLookup;
65 $this->dbProvider = $dbProvider;
66 $this->mediaTypes = $mimeAnalyzer->getMediaTypes();
67 $this->linkBatchFactory = $linkBatchFactory;
83 $opts->
add(
'hidepatrolled',
false );
84 $opts->
add(
'mediatype', $this->mediaTypes );
92 if ( $par !==
null ) {
100 if ( $start !==
'' && $end !==
'' && $start > $end ) {
110 $request = $context->getRequest();
113 [
'start' => $start,
'end' => $end ] + $request->getValues(),
114 $request->wasPosted()
125 if ( !array_diff( $this->mediaTypes,
$mediaTypes ) ) {
141 $this->groupPermissionsLookup,
142 $this->linkBatchFactory,
148 $out->addHTML( $pager->getBody() );
150 $out->addHTML( $pager->getNavigationBar() );
155 $mediaTypesText = array_map(
function ( $type ) {
162 return $this->
msg(
'mediastatistics-header-' . strtolower( $type ) )->escaped();
164 $mediaTypesOptions = array_combine( $mediaTypesText, $this->mediaTypes );
165 ksort( $mediaTypesOptions );
169 'class' => HTMLUserTextField::class,
170 'label-message' =>
'newimages-user',
176 'label-message' =>
'newimages-showbots',
177 'name' =>
'showbots',
182 'label-message' =>
'newimages-hidepatrolled',
183 'name' =>
'hidepatrolled',
187 'type' =>
'multiselect',
189 'name' =>
'mediatype',
190 'label-message' =>
'newimages-mediatype',
191 'options' => $mediaTypesOptions,
197 'default' => $this->opts->getValue(
'limit' ),
203 'default' => $this->opts->getValue(
'offset' ),
209 'label-message' =>
'date-range-from',
215 'label-message' =>
'date-range-to',
220 if ( !$this->
getUser()->useFilePatrol() ) {
221 unset( $formDescriptor[
'hidepatrolled'] );
224 HTMLForm::factory(
'ooui', $formDescriptor, $context )
226 ->setFormIdentifier(
'specialnewimages' )
227 ->setWrapperLegendMsg(
'newimages-legend' )
228 ->setSubmitTextMsg(
'ilsubmit' )
231 ->displayForm(
false );
242 $message = $this->
msg(
'newimagestext' )->inContentLanguage();
243 if ( !$message->isDisabled() ) {
245 $this->
getOutput()->addWikiTextAsContent(
246 Html::rawElement(
'div',
248 'lang' => $contLang->getHtmlCode(),
249 'dir' => $contLang->getDir()
251 "\n" . $message->plain() .
"\n"
262class_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 Per default the message key is the canonical name o...
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Interface for objects which can provide a MediaWiki context on request.