Go to the documentation of this file.
34 parent::__construct(
'Newimages' );
43 $this->mediaTypes = $mimeAnalyzer->getMediaTypes();
53 $opts->
add(
'hidepatrolled',
false );
54 $opts->
add(
'mediatype', $this->mediaTypes );
62 if ( $par !==
null ) {
63 $opts->
setValue( is_numeric( $par ) ?
'limit' :
'like', $par );
70 if ( $start !==
'' && $end !==
'' && $start > $end ) {
83 [
'start' => $start,
'end' => $end ] + $request->getValues(),
91 $missingMediaTypes = array_diff( $this->mediaTypes,
$opts->
getValue(
'mediatype' ) );
92 if ( empty( $missingMediaTypes ) ) {
107 $out->addHTML( $pager->getBody() );
109 $out->addHTML( $pager->getNavigationBar() );
114 $mediaTypesText = array_map(
function (
$type ) {
121 return $this->
msg(
'mediastatistics-header-' . strtolower(
$type ) )->text();
123 $mediaTypesOptions = array_combine( $mediaTypesText, $this->mediaTypes );
124 ksort( $mediaTypesOptions );
129 'label-message' =>
'newimages-label',
134 'class' =>
'HTMLUserTextField',
135 'label-message' =>
'newimages-user',
141 'label-message' =>
'newimages-showbots',
142 'name' =>
'showbots',
147 'label-message' =>
'newimages-hidepatrolled',
148 'name' =>
'hidepatrolled',
152 'type' =>
'multiselect',
154 'name' =>
'mediatype',
155 'label-message' =>
'newimages-mediatype',
156 'options' => $mediaTypesOptions,
162 'default' => $this->opts->getValue(
'limit' ),
168 'default' => $this->opts->getValue(
'offset' ),
174 'label-message' =>
'date-range-from',
180 'label-message' =>
'date-range-to',
185 if ( $this->
getConfig()->
get(
'MiserMode' ) ) {
186 unset( $formDescriptor[
'like'] );
189 if ( !$this->
getUser()->useFilePatrol() ) {
190 unset( $formDescriptor[
'hidepatrolled'] );
195 ->setFormIdentifier(
'specialnewimages' )
196 ->setWrapperLegendMsg(
'newimages-legend' )
197 ->setSubmitTextMsg(
'ilsubmit' )
200 ->displayForm(
false );
211 $message = $this->
msg(
'newimagestext' )->inContentLanguage();
212 if ( !$message->isDisabled() ) {
213 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
214 $this->
getOutput()->addWikiTextAsContent(
215 Html::rawElement(
'div',
218 'lang' => $contLang->getHtmlCode(),
219 'dir' => $contLang->getDir()
221 "\n" . $message->plain() .
"\n"
buildForm(IContextSource $context)
Similar to FauxRequest, but only fakes URL parameters and method (POST or GET) and use the base reque...
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
Shortcut to construct an includable special page.
setTopText()
Send the text to be displayed above the options.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
An IContextSource implementation which will inherit context from another source but allow individual ...
getConfig()
Shortcut to get main config object.
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.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Interface for objects which can provide a MediaWiki context on request.
execute( $par)
Default execute method Checks user permissions.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
including( $x=null)
Whether the special page is being evaluated via transclusion.