51 MimeAnalyzer $mimeAnalyzer,
56 parent::__construct(
'Newimages' );
59 $this->mediaTypes = $mimeAnalyzer->getMediaTypes();
77 $opts->
add(
'hidepatrolled',
false );
78 $opts->
add(
'mediatype', $this->mediaTypes );
86 if ( $par !==
null ) {
87 $opts->
setValue( is_numeric( $par ) ?
'limit' :
'like', $par );
94 if ( $start !==
'' && $end !==
'' && $start > $end ) {
104 $request = $context->getRequest();
107 [
'start' => $start,
'end' => $end ] + $request->getValues(),
108 $request->wasPosted()
115 $missingMediaTypes = array_diff( $this->mediaTypes,
$opts->
getValue(
'mediatype' ) );
116 if ( empty( $missingMediaTypes ) ) {
133 $this->groupPermissionsLookup,
135 $this->linkBatchFactory
138 $out->addHTML( $pager->getBody() );
140 $out->addHTML( $pager->getNavigationBar() );
145 $mediaTypesText = array_map(
function (
$type ) {
152 return $this->
msg(
'mediastatistics-header-' . strtolower(
$type ) )->escaped();
154 $mediaTypesOptions = array_combine( $mediaTypesText, $this->mediaTypes );
155 ksort( $mediaTypesOptions );
160 'label-message' =>
'newimages-label',
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->
getConfig()->
get(
'MiserMode' ) ) {
217 unset( $formDescriptor[
'like'] );
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"
An IContextSource implementation which will inherit context from another source but allow individual ...
Similar to FauxRequest, but only fakes URL parameters and method (POST or GET) and use the base reque...
Shortcut to construct an includable special page.
buildForm(IContextSource $context)
execute( $par)
Default execute method Checks user permissions.
ILoadBalancer $loadBalancer
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
GroupPermissionsLookup $groupPermissionsLookup
__construct(MimeAnalyzer $mimeAnalyzer, GroupPermissionsLookup $groupPermissionsLookup, ILoadBalancer $loadBalancer, LinkBatchFactory $linkBatchFactory)
setTopText()
Send the text to be displayed above the options.
LinkBatchFactory $linkBatchFactory
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getOutput()
Get the OutputPage being used for this instance.
getUser()
Shortcut to get the User executing this instance.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getConfig()
Shortcut to get main config object.
getRequest()
Get the WebRequest being used for this instance.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
getContentLanguage()
Shortcut to get content language.
including( $x=null)
Whether the special page is being evaluated via transclusion.
Interface for objects which can provide a MediaWiki context on request.