63 $this->displayImg =
$file;
64 $this->fileLoaded =
true;
68 if ( $this->fileLoaded ) {
71 $this->fileLoaded =
true;
73 $this->displayImg = $img =
false;
75 $this->getHookRunner()->onImagePageFindFile( $this, $img, $this->displayImg );
77 $services = MediaWikiServices::getInstance();
78 $img = $services->getRepoGroup()->findFile( $this->
getTitle() );
80 $img = $services->getRepoGroup()->getLocalRepo()->newFile( $this->
getTitle() );
83 $this->
getPage()->setFile( $img );
84 if ( !$this->displayImg ) {
85 $this->displayImg = $img;
87 $this->repo = $img->getRepo();
94 if ( $this->viewIsRenderAction ) {
101 $diff = $request->getVal(
'diff' );
102 $diffOnly = $request->getBool(
107 if ( $this->
getTitle()->getNamespace() !=
NS_FILE || ( $diff !==
null && $diffOnly ) ) {
116 && $this->
getFile()->getRedirected()
122 $request->setVal(
'diffonly',
'true' );
129 if (
$wgShowEXIF && $this->displayImg->exists() ) {
131 $formattedMetadata = $this->displayImg->formatMetadata( $this->
getContext() );
132 $showmeta = $formattedMetadata !==
false;
137 if ( !$diff && $this->displayImg->exists() ) {
138 $out->addHTML( $this->
showTOC( $showmeta ) );
145 # No need to display noarticletext, we use our own message, output in openShowImage()
147 # NS_FILE is in the user language, but this section (the actual wikitext)
148 # should be in page content language
149 $pageLang = $this->
getTitle()->getPageViewLanguage();
150 $out->addHTML( Xml::openElement(
'div', [
'id' =>
'mw-imagepage-content',
151 'lang' => $pageLang->getHtmlCode(),
'dir' => $pageLang->getDir(),
152 'class' =>
'mw-content-' . $pageLang->getDir() ] ) );
156 $out->addHTML( Xml::closeElement(
'div' ) );
158 # Just need to set the right headers
159 $out->setArticleFlag(
true );
160 $out->setPageTitle( $this->
getTitle()->getPrefixedText() );
161 $this->
getPage()->doViewUpdates(
167 # Show shared description, if needed
168 if ( $this->mExtraDescription ) {
169 $fol = $this->
getContext()->msg(
'shareddescriptionfollows' );
170 if ( !$fol->isDisabled() ) {
171 $out->addWikiTextAsInterface( $fol->plain() );
173 $out->addHTML(
'<div id="shared-image-desc">' . $this->mExtraDescription .
"</div>\n" );
180 $out->addHTML( Xml::element(
'h2',
181 [
'id' =>
'filelinks' ],
182 $this->
getContext()->msg(
'imagelinks' )->text() ) .
"\n" );
184 # @todo FIXME: For some freaky reason, we can't redirect to foreign images.
185 # Yet we return metadata about the target. Definitely an issue in the FileRepo
188 # Allow extensions to add something after the image links
190 $this->getHookRunner()->onImagePageAfterImageLinks( $this, $html );
192 $out->addHTML( $html );
196 '@phan-var array $formattedMetadata';
197 $out->addHTML( Xml::element(
199 [
'id' =>
'metadata' ],
200 $this->
getContext()->msg(
'metadata' )->text() ) .
"\n" );
201 $out->wrapWikiTextAsInterface(
202 'mw-imagepage-section-metadata',
205 $out->addModules( [
'mediawiki.action.view.metadata' ] );
209 if ( !$this->repo->isLocal() ) {
210 $css = $this->repo->getDescriptionStylesheetUrl();
212 $out->addStyle( $css );
216 $out->addModuleStyles( [
218 'mediawiki.action.view.filepage',
227 return $this->displayImg;
238 '<li><a href="#file">' . $this->
getContext()->msg(
'file-anchor-link' )->escaped() .
'</a></li>',
239 '<li><a href="#filehistory">' . $this->
getContext()->msg(
'filehist' )->escaped() .
'</a></li>',
240 '<li><a href="#filelinks">' . $this->
getContext()->msg(
'imagelinks' )->escaped() .
'</a></li>',
243 $this->getHookRunner()->onImagePageShowTOC( $this, $r );
246 $r[] =
'<li><a href="#metadata">' .
247 $this->
getContext()->msg(
'metadata' )->escaped() .
251 return '<ul id="filetoc">' . implode(
"\n", $r ) .
'</ul>';
263 $r = $this->
getContext()->msg(
'metadata-help' )->plain();
266 $r .=
"<table id=\"mw_metadata\" class=\"mw_metadata collapsed\">\n";
267 foreach ( $metadata as
$type => $stuff ) {
268 foreach ( $stuff as $v ) {
269 $class = str_replace(
' ',
'_', $v[
'id'] );
270 if (
$type ==
'collapsed' ) {
271 $class .=
' mw-metadata-collapsible';
273 $r .= Html::rawElement(
'tr',
274 [
'class' => $class ],
275 Html::rawElement(
'th', [], $v[
'name'] )
276 . Html::rawElement(
'td', [], $v[
'value'] )
302 return parent::getEmptyPageParserOutput( $options );
314 $handler =
$file->getHandler();
319 $config = MediaWikiServices::getInstance()->getMainConfig();
320 $requestLanguage = $request->
getVal(
'lang', $config->get(
'LanguageCode' ) );
321 if ( $handler->validateParam(
'lang', $requestLanguage ) ) {
322 return $file->getMatchedLanguage( $requestLanguage );
325 return $handler->getDefaultRenderLanguage(
$file );
335 $dirmark =
$lang->getDirMarkEntity();
338 if ( $this->displayImg->exists() ) {
342 $page = $request->getIntOrNull(
'page' );
343 if ( $page ===
null ) {
347 $params = [
'page' => $page ];
351 if ( $renderLang !==
null ) {
352 $params[
'lang'] = $renderLang;
355 $width_orig = $this->displayImg->getWidth( $page );
356 $width = $width_orig;
357 $height_orig = $this->displayImg->getHeight( $page );
358 $height = $height_orig;
361 $linktext = $filename;
363 $this->getHookRunner()->onImageOpenShowImageInlineBefore( $this, $out );
365 if ( $this->displayImg->allowInlineDisplay() ) {
367 # "Download high res version" link below the image
368 # $msgsize = $this->getContext()->msg( 'file-info-size', $width_orig, $height_orig,
369 # Language::formatSize( $this->displayImg->getSize() ), $mime )->escaped();
370 # We'll show a thumbnail of this image
371 if ( $width > $maxWidth ||
372 $height > $maxHeight ||
373 $this->displayImg->isVectorized()
375 list( $width, $height ) = $this->displayImg->getDisplayWidthHeight(
376 $maxWidth, $maxHeight, $page
378 $linktext = $this->
getContext()->msg(
'show-big-image' )->escaped();
380 $thumbSizes = $this->
getThumbSizes( $width_orig, $height_orig );
381 # Generate thumbnails or thumbnail links as needed...
383 foreach ( $thumbSizes as $size ) {
392 if ( ( ( $size[0] <= $width_orig && $size[1] <= $height_orig )
393 || ( $this->displayImg->isVectorized()
396 && $size[0] != $width && $size[1] != $height
398 $sizeLink = $this->
makeSizeLink( $params, $size[0], $size[1] );
400 $otherSizes[] = $sizeLink;
404 $otherSizes = array_unique( $otherSizes );
406 $sizeLinkBigImagePreview = $this->
makeSizeLink( $params, $width, $height );
408 if ( count( $otherSizes ) ) {
412 [
'class' =>
'mw-filepage-other-resolutions' ],
413 $this->
getContext()->msg(
'show-big-image-other' )
414 ->rawParams(
$lang->pipeList( $otherSizes ) )
415 ->params( count( $otherSizes ) )
419 } elseif ( $width == 0 && $height == 0 ) {
420 # Some sort of audio file that doesn't have dimensions
421 # Don't output a no hi res message for such a file
424 # Image is small enough to show full size on image page
425 $msgsmall = $this->
getContext()->msg(
'file-nohires' )->parse();
428 $params[
'width'] = $width;
429 $params[
'height'] = $height;
432 $params[
'imagePageParams'] = $request->getQueryValuesOnly();
433 $thumbnail = $this->displayImg->transform( $params );
436 $anchorclose = Html::rawElement(
438 [
'class' =>
'mw-filepage-resolutioninfo' ],
442 $isMulti = $this->displayImg->isMultipage() && $this->displayImg->pageCount() > 1;
444 $out->addModules(
'mediawiki.page.image.pagination' );
445 $out->addHTML(
'<table class="multipageimage"><tr><td>' );
450 'alt' => $this->displayImg->getTitle()->getPrefixedText(),
453 $out->addHTML(
'<div class="fullImageLink" id="file">' .
454 $thumbnail->toHtml( $options ) .
455 $anchorclose .
"</div>\n" );
459 $count = $this->displayImg->pageCount();
460 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
463 $label = $this->
getContext()->msg(
'imgmultipageprev' )->text();
470 [
'page' => $page - 1 ]
478 [
'page' => $page - 1 ]
484 if ( $page < $count ) {
485 $label = $this->
getContext()->msg(
'imgmultipagenext' )->text();
490 [
'page' => $page + 1 ]
498 [
'page' => $page + 1 ]
507 'name' =>
'pageselector',
511 for ( $i = 1; $i <= $count; $i++ ) {
512 $options[] = Xml::option(
$lang->formatNum( $i ), $i, $i == $page );
514 $select = Xml::tags(
'select',
515 [
'id' =>
'pageselector',
'name' =>
'page' ],
516 implode(
"\n", $options ) );
519 '</td><td><div class="multipageimagenavbox">' .
520 Xml::openElement(
'form', $formParams ) .
521 Html::hidden(
'title', $this->
getTitle()->getPrefixedDBkey() ) .
522 $this->
getContext()->msg(
'imgmultigoto' )->rawParams( $select )->parse() .
523 $this->
getContext()->msg(
'word-separator' )->escaped() .
524 Xml::submitButton( $this->
getContext()->msg(
'imgmultigo' )->text() ) .
525 Xml::closeElement(
'form' ) .
526 "<hr />$thumb1\n$thumb2<br style=\"clear: both\" /></div></td></tr></table>"
529 } elseif ( $this->displayImg->isSafeFile() ) {
530 # if direct link is allowed but it's not a renderable image, show an icon.
531 $icon = $this->displayImg->iconThumb();
533 $out->addHTML(
'<div class="fullImageLink" id="file">' .
534 $icon->toHtml( [
'file-link' =>
true ] ) .
538 $longDesc = $this->
getContext()->msg(
'parentheses', $this->displayImg->getLongDesc() )->text();
540 $handler = $this->displayImg->getHandler();
544 $warningConfig = $handler->getWarningConfig( $this->displayImg );
546 if ( $warningConfig !==
null ) {
550 $output->addJsConfigVars(
'wgFileWarning', $warningConfig );
551 $output->addModules( $warningConfig[
'module'] );
552 $output->addModules(
'mediawiki.filewarning' );
556 $medialink =
"[[Media:$filename|$linktext]]";
558 if ( !$this->displayImg->isSafeFile() ) {
559 $warning = $this->
getContext()->msg(
'mediawarning' )->plain();
568 $out->wrapWikiTextAsInterface(
'fullMedia', <<<EOT
569<span
class=
"dangerousLink">{$medialink}</span> $dirmark<span
class=
"fileInfo">$longDesc</span>
573 $out->wrapWikiTextAsInterface(
'mediaWarning', $warning );
575 $out->wrapWikiTextAsInterface(
'fullMedia', <<<EOT
576{$medialink} {$dirmark}<span
class=
"fileInfo">$longDesc</span>
581 $renderLangOptions = $this->displayImg->getAvailableLanguages();
582 if ( count( $renderLangOptions ) >= 1 ) {
583 $out->addHTML( $this->
doRenderLangOpt( $renderLangOptions, $renderLang ) );
587 if ( !$this->displayImg->canAnimateThumbIfAppropriate() ) {
593 $ext = $this->displayImg->getExtension();
595 'file-no-thumb-animation-' .
$ext,
596 'file-no-thumb-animation'
599 $out->wrapWikiTextAsInterface(
'mw-noanimatethumb', $noAnimMesg );
602 if ( !$this->displayImg->isLocal() ) {
606 # Image does not exist
610 # No article exists either
611 # Show deletion log to be consistent with normal articles
612 LogEventsList::showLogExtract(
614 [
'delete',
'move',
'protect' ],
615 $this->
getTitle()->getPrefixedText(),
618 'conds' => [
'log_action != ' .
$dbr->addQuotes(
'revision' ) ],
619 'showIfEmpty' =>
false,
620 'msgKey' => [
'moveddeleted-notice' ]
627 ->userHasRight( $user,
'upload' )
632 'filepage-nofile-link',
633 $uploadTitle->getFullURL( [
634 'wpDestFile' => $this->
getFile()->getName()
638 $nofile =
'filepage-nofile';
643 $out->setRobotPolicy(
'noindex,nofollow' );
644 $out->wrapWikiMsg(
"<div id='mw-imagepage-nofile' class='plainlinks'>\n$1\n</div>", $nofile );
648 $request->response()->statusHeader( 404 );
651 $out->setFileVersion( $this->displayImg );
662 if ( $sizeLinkBigImagePreview ) {
664 $previewTypeDiffers =
false;
665 $origExt = $thumbExt = $this->displayImg->getExtension();
666 if ( $this->displayImg->getHandler() ) {
667 $origMime = $this->displayImg->getMimeType();
668 $typeParams = $params;
669 $this->displayImg->getHandler()->normaliseParams( $this->displayImg, $typeParams );
670 list( $thumbExt, $thumbMime ) = $this->displayImg->getHandler()->getThumbType(
671 $origExt, $origMime, $typeParams );
672 if ( $thumbMime !== $origMime ) {
673 $previewTypeDiffers =
true;
676 if ( $previewTypeDiffers ) {
677 return $this->
getContext()->msg(
'show-big-image-preview-differ' )->
678 rawParams( $sizeLinkBigImagePreview )->
679 params( strtoupper( $origExt ) )->
680 params( strtoupper( $thumbExt ) )->
683 return $this->
getContext()->msg(
'show-big-image-preview' )->
684 rawParams( $sizeLinkBigImagePreview )->
700 $params[
'width'] = $width;
701 $params[
'height'] = $height;
702 $thumbnail = $this->displayImg->transform( $params );
703 if ( $thumbnail && !$thumbnail->isError() ) {
704 return Html::rawElement(
'a', [
705 'href' => $thumbnail->getUrl(),
706 'class' =>
'mw-thumbnail-link'
707 ], $this->getContext()->msg(
'show-big-image-size' )->numParams(
708 $thumbnail->getWidth(), $thumbnail->getHeight()
722 $descUrl = $this->
getFile()->getDescriptionUrl();
723 $descText = $this->
getFile()->getDescriptionText( $this->
getContext()->getLanguage() );
727 $out->setCanonicalUrl( $descUrl );
730 $wrap =
"<div class=\"sharedUploadNotice\">\n$1\n</div>\n";
735 $this->
getContext()->msg(
'sharedupload-desc-here' )->plain() !==
'-'
737 $out->wrapWikiMsg( $wrap, [
'sharedupload-desc-here',
$repo, $descUrl ] );
738 } elseif ( $descUrl &&
739 $this->
getContext()->msg(
'sharedupload-desc-there' )->plain() !==
'-'
741 $out->wrapWikiMsg( $wrap, [
'sharedupload-desc-there',
$repo, $descUrl ] );
743 $out->wrapWikiMsg( $wrap, [
'sharedupload',
$repo ],
'' );
747 $this->mExtraDescription = $descText;
754 return $uploadTitle->getFullURL( [
755 'wpDestFile' => $this->
getFile()->getName(),
764 if ( !$this->
getContext()->getConfig()->
get(
'EnableUploads' ) ) {
773 $canUpload = MediaWikiServices::getInstance()->getPermissionManager()
775 if ( $canUpload && UploadBase::userCanReUpload(
782 $this->
getContext()->msg(
'uploadnewversion-linktext' )->text()
784 $attrs = [
'class' =>
'plainlinks',
'id' =>
'mw-imagepage-reupload-link' ];
785 $linkPara = Html::rawElement(
'p', $attrs, $ulink );
788 $attrs = [
'id' =>
'mw-imagepage-upload-disallowed' ];
789 $msg = $this->
getContext()->msg(
'upload-disallowed-here' )->text();
790 $linkPara = Html::element(
'p', $attrs, $msg );
793 $uploadLinks = Html::rawElement(
'div', [
'class' =>
'mw-imagepage-upload-links' ], $linkPara );
794 $this->
getContext()->getOutput()->addHTML( $uploadLinks );
811 $out->addHTML( $pager->getBody() );
812 $out->preventClickjacking( $pager->getPreventClickjacking() );
814 $this->
getFile()->resetHistory();
816 # Exist check because we don't want to show this on pages where an image
817 # doesn't exist along with the noimage message, that would suck. -ævar
832 [
'imagelinks',
'page' ],
833 [
'page_namespace',
'page_title',
'il_to' ],
834 [
'il_to' => $target,
'il_from = page_id' ],
836 [
'LIMIT' => $limit + 1,
'ORDER BY' =>
'il_from', ]
848 $redirects[$redir->getDBkey()] = [];
851 'page_title' => $redir->getDBkey(),
856 foreach (
$res as $row ) {
859 $count = count( $rows );
861 $hasMore = $count > $limit;
862 if ( !$hasMore && count( $redirects ) ) {
864 $limit - count( $rows ) + 1 );
865 foreach (
$res as $row ) {
866 $redirects[$row->il_to][] = $row;
869 $hasMore = (
$res->numRows() + count( $rows ) ) > $limit;
874 Html::rawElement(
'div',
875 [
'id' =>
'mw-imagepage-nolinkstoimage' ],
"\n$1\n" ),
881 $out->addHTML(
"<div id='mw-imagepage-section-linkstoimage'>\n" );
883 $out->addWikiMsg(
'linkstoimage', $count );
886 $out->addWikiMsg(
'linkstoimage-more',
887 $this->
getContext()->getLanguage()->formatNum( $limit ),
888 $this->
getTitle()->getPrefixedDBkey()
893 Html::openElement(
'ul',
894 [
'class' =>
'mw-imagepage-linkstoimage' ] ) .
"\n"
897 usort( $rows, [ $this,
'compare' ] );
899 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
903 foreach ( $rows as $element ) {
905 if ( $currentCount > $limit ) {
910 # Add a redirect=no to make redirect pages reachable
911 if ( isset( $redirects[$element->page_title] ) ) {
912 $query[
'redirect'] =
'no';
915 Title::makeTitle( $element->page_namespace, $element->page_title ),
918 if ( !isset( $redirects[$element->page_title] ) ) {
921 } elseif ( count( $redirects[$element->page_title] ) === 0 ) {
922 # Redirect without usages
923 $liContents = $this->
getContext()->msg(
'linkstoimage-redirect' )
924 ->rawParams( $link,
'' )
927 # Redirect with usages
929 foreach ( $redirects[$element->page_title] as $row ) {
931 if ( $currentCount > $limit ) {
936 Title::makeTitle( $row->page_namespace, $row->page_title ) );
937 $li .= Html::rawElement(
939 [
'class' =>
'mw-imagepage-linkstoimage-ns' . $element->page_namespace ],
944 $ul = Html::rawElement(
946 [
'class' =>
'mw-imagepage-redirectstofile' ],
949 $liContents = $this->
getContext()->msg(
'linkstoimage-redirect' )->rawParams(
950 $link,
$ul )->parse();
952 $out->addHTML( Html::rawElement(
954 [
'class' =>
'mw-imagepage-linkstoimage-ns' . $element->page_namespace ],
960 $out->addHTML( Html::closeElement(
'ul' ) .
"\n" );
964 if ( $currentCount > $limit ) {
965 $out->addWikiMsg(
'morelinkstoimage', $this->
getTitle()->getPrefixedDBkey() );
967 $out->addHTML( Html::closeElement(
'div' ) .
"\n" );
974 $dupes = $this->
getPage()->getDuplicates();
975 if ( count( $dupes ) == 0 ) {
979 $out->addHTML(
"<div id='mw-imagepage-section-duplicates'>\n" );
980 $out->addWikiMsg(
'duplicatesoffile',
981 $this->
getContext()->getLanguage()->formatNum( count( $dupes ) ), $this->
getTitle()->getDBkey()
983 $out->addHTML(
"<ul class='mw-imagepage-duplicates'>\n" );
985 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
990 foreach ( $dupes as
$file ) {
992 if (
$file->isLocal() ) {
996 $file->getTitle()->getPrefixedText() );
999 $file->getRepo()->getDisplayName()
1002 $out->addHTML(
"<li>{$link} {$fromSrc}</li>\n" );
1004 $out->addHTML(
"</ul></div>\n" );
1010 public function delete() {
1012 if ( !
$file->exists() || !
$file->isLocal() ||
$file->getRedirected() ) {
1017 '@phan-var LocalFile $file';
1020 $deleter->execute();
1030 $out->setPageTitle( $this->
getContext()->msg(
'internalerror' ) );
1031 $out->setRobotPolicy(
'noindex,nofollow' );
1032 $out->setArticleRelated(
false );
1033 $out->enableClientCache(
false );
1034 $out->addWikiTextAsInterface( $description );
1046 return $a->page_namespace <=> $b->page_namespace
1047 ?: strcmp( $a->page_title, $b->page_title );
1060 return MediaFileTrait::getImageLimitsFromOption( $user, $optionName );
1074 $matchedRenderLang = $this->displayImg->getMatchedLanguage( $renderLang );
1076 foreach ( $langChoices as
$lang ) {
1079 $matchedRenderLang ===
$lang
1087 $this->
getContext()->msg(
'img-lang-default' )->text(),
1089 $matchedRenderLang ===
null
1092 $select = Html::rawElement(
1094 [
'id' =>
'mw-imglangselector',
'name' =>
'lang' ],
1097 $submit = Xml::submitButton( $this->
getContext()->msg(
'img-lang-go' )->text() );
1099 $formContents = $this->
getContext()->msg(
'img-lang-info' )
1100 ->rawParams( $select, $submit )
1102 $formContents .= Html::hidden(
'title', $this->
getTitle()->getPrefixedDBkey() );
1104 $langSelectLine = Html::rawElement(
'div', [
'id' =>
'mw-imglangselector-line' ],
1105 Html::rawElement(
'form', [
'action' =>
$wgScript ], $formContents )
1107 return $langSelectLine;
1116 $code = LanguageCode::bcp47(
$lang );
1117 $name = MediaWikiServices::getInstance()
1118 ->getLanguageNameUtils()
1119 ->getLanguageName( $code, $this->
getContext()->getLanguage()->getCode() );
1120 if ( $name !==
'' ) {
1121 $display = $this->
getContext()->msg(
'img-lang-opt', $code, $name )->text();
1144 if ( $this->displayImg->getRepo()->canTransformVia404() ) {
1152 $thumbSizes[] = [ $origWidth, $origHeight ];
1154 # Creating thumb links triggers thumbnail generation.
1155 # Just generate the thumb for the current users prefs.
1159 if ( !$this->displayImg->mustRender() ) {
1162 $thumbSizes[] = [ $origWidth, $origHeight ];
1173 return $this->
getPage()->getFile();
1181 return $this->
getPage()->isLocal();
1189 return $this->
getPage()->getDuplicates();
1197 return $this->
getPage()->getForeignCategories();
$wgScript
The URL path to index.php.
$wgSend404Code
Some web hosts attempt to rewrite all responses with a 404 (not found) status code,...
$wgImageLimits
Limit images on image description pages to a user-selectable limit.
$wgSVGMaxSize
Don't scale a SVG larger than this.
$wgEnableUploads
Allow users to upload files.
$wgShowEXIF
Show Exif data, on by default if available.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfMessageFallback(... $keys)
This function accepts multiple message keys and returns a message instance for the first message whic...
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
getFile()
Get the file for this page, if one exists.
Class for viewing MediaWiki article and history.
LinkRenderer $linkRenderer
getPage()
Get the WikiPage object of this instance.
Base class for file repositories.
getDisplayName()
Get the human-readable name of the repo.
Implements some public methods and some protected utility functions which are required by multiple ch...
Class for viewing MediaWiki file description pages.
getLanguageForRendering(WebRequest $request, File $file)
Returns language code to be used for dispaying the image, based on request context and languages avai...
showError( $description)
Display an error with a wikitext description.
imageHistory()
If the page we've just displayed is in the "Image" namespace, we follow it with an upload history of ...
compare( $a, $b)
Callback for usort() to do link sorts by (namespace, title) Function copied from Title::compare()
createXmlOptionStringForLanguage( $lang, $selected)
getThumbSizes( $origWidth, $origHeight)
Get alternative thumbnail sizes.
getImageLimitsFromOption( $user, $optionName)
Returns the corresponding $wgImageLimits entry for the selected user option.
makeSizeLink( $params, $width, $height)
Creates an thumbnail of specified size and returns an HTML link to it.
doRenderLangOpt(array $langChoices, $renderLang)
Output a drop-down box for language options for the file.
makeMetadataTable( $metadata)
Make a table with metadata to be shown in the output page.
getEmptyPageParserOutput(ParserOptions $options)
Overloading Article's getEmptyPageParserOutput method.
queryImageLinks( $target, $limit)
uploadLinksBox()
Add the re-upload link (or message about not being able to re-upload) to the output.
printSharedImageText()
Show a notice that the file is from a shared repository.
closeShowImage()
For overloading.
showTOC( $metadata)
Create the TOC.
view()
This is the default action of the index.php entry point: just view the page of the given title.
getThumbPrevText( $params, $sizeLinkBigImagePreview)
Make the text under the image to say what size preview.
static processResponsiveImages( $file, $thumb, $hp)
Process responsive images: add 1.5x and 2x subimages to the thumbnail, where applicable.
static makeThumbLinkObj(LinkTarget $title, $file, $label='', $alt='', $align='right', $params=[], $framed=false, $manualthumb="")
Make HTML for a thumbnail including image, border and caption.
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null)
Make an external link.
Set options of the Parser.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Represents a title within MediaWiki.
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
getVal( $name, $default=null)
Fetch a scalar from the input or return $default if it's not set.
Special handling for file pages.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
if(!is_readable( $file)) $ext
if(!isset( $args[0])) $lang