64 $this->displayImg =
$file;
65 $this->fileLoaded =
true;
69 if ( $this->fileLoaded ) {
72 $this->fileLoaded =
true;
74 $this->displayImg = $img =
false;
76 $this->getHookRunner()->onImagePageFindFile( $this, $img, $this->displayImg );
78 $services = MediaWikiServices::getInstance();
79 $img = $services->getRepoGroup()->findFile( $this->
getTitle() );
81 $img = $services->getRepoGroup()->getLocalRepo()->newFile( $this->
getTitle() );
84 $this->
getPage()->setFile( $img );
85 if ( !$this->displayImg ) {
86 $this->displayImg = $img;
88 $this->repo = $img->getRepo();
95 if ( $this->viewIsRenderAction ) {
102 $diff = $request->getVal(
'diff' );
103 $diffOnly = $request->getBool(
105 $this->
getContext()->getUser()->getOption(
'diffonly' )
108 if ( $this->
getTitle()->getNamespace() !==
NS_FILE || ( $diff !==
null && $diffOnly ) ) {
117 && $this->
getFile()->getRedirected()
123 $request->setVal(
'diffonly',
'true' );
130 if (
$wgShowEXIF && $this->displayImg->exists() ) {
132 $formattedMetadata = $this->displayImg->formatMetadata( $this->
getContext() );
134 $formattedMetadata =
false;
137 if ( !$diff && $this->displayImg->exists() ) {
138 $out->addHTML( $this->
showTOC( (
bool)$formattedMetadata ) );
145 # No need to display noarticletext, we use our own message, output in openShowImage()
146 if ( $this->
getPage()->getId() ) {
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() );
176 [
'id' =>
'shared-image-desc' ],
177 $this->mExtraDescription
186 $out->addHTML( Xml::element(
'h2',
187 [
'id' =>
'filelinks' ],
188 $this->
getContext()->msg(
'imagelinks' )->text() ) .
"\n" );
190 # @todo FIXME: For some freaky reason, we can't redirect to foreign images.
191 # Yet we return metadata about the target. Definitely an issue in the FileRepo
194 # Allow extensions to add something after the image links
196 $this->getHookRunner()->onImagePageAfterImageLinks( $this, $html );
198 $out->addHTML( $html );
201 if ( $formattedMetadata ) {
202 $out->addHTML( Xml::element(
204 [
'id' =>
'metadata' ],
205 $this->
getContext()->msg(
'metadata' )->text() ) .
"\n" );
206 $out->wrapWikiTextAsInterface(
207 'mw-imagepage-section-metadata',
210 $out->addModules( [
'mediawiki.action.view.metadata' ] );
214 if ( !$this->repo->isLocal() ) {
215 $css = $this->repo->getDescriptionStylesheetUrl();
217 $out->addStyle( $css );
221 $out->addModuleStyles( [
223 'mediawiki.action.view.filepage',
232 return $this->displayImg;
248 [
'href' =>
'#file' ],
249 $this->
getContext()->msg(
'file-anchor-link' )->escaped()
257 [
'href' =>
'#filehistory' ],
258 $this->
getContext()->msg(
'filehist' )->escaped()
266 [
'href' =>
'#filelinks' ],
267 $this->
getContext()->msg(
'imagelinks' )->escaped()
272 $this->getHookRunner()->onImagePageShowTOC( $this, $r );
275 $r[] = Html::rawElement(
280 [
'href' =>
'#metadata' ],
281 $this->
getContext()->msg(
'metadata' )->escaped()
286 return Html::rawElement(
'ul', [
'id' =>
'filetoc' ], implode(
"\n", $r ) );
298 $r = $this->
getContext()->msg(
'metadata-help' )->plain();
301 $r .=
"<table id=\"mw_metadata\" class=\"mw_metadata collapsed\">\n";
302 foreach ( $metadata as
$type => $stuff ) {
303 foreach ( $stuff as $v ) {
304 $class = str_replace(
' ',
'_', $v[
'id'] );
305 if (
$type ==
'collapsed' ) {
306 $class .=
' mw-metadata-collapsible';
308 $r .= Html::rawElement(
'tr',
309 [
'class' => $class ],
310 Html::rawElement(
'th', [], $v[
'name'] )
311 . Html::rawElement(
'td', [], $v[
'value'] )
328 $handler =
$file->getHandler();
333 $config = MediaWikiServices::getInstance()->getMainConfig();
334 $requestLanguage = $request->
getVal(
'lang', $config->get(
'LanguageCode' ) );
335 if ( $handler->validateParam(
'lang', $requestLanguage ) ) {
336 return $file->getMatchedLanguage( $requestLanguage );
339 return $handler->getDefaultRenderLanguage(
$file );
349 $dirmark =
$lang->getDirMarkEntity();
352 if ( $this->displayImg->exists() ) {
356 $page = $request->getIntOrNull(
'page' );
357 if ( $page ===
null ) {
361 $params = [
'page' => $page ];
365 if ( $renderLang !==
null ) {
366 $params[
'lang'] = $renderLang;
369 $width_orig = $this->displayImg->getWidth( $page );
370 $width = $width_orig;
371 $height_orig = $this->displayImg->getHeight( $page );
372 $height = $height_orig;
375 $linktext = $filename;
377 $this->getHookRunner()->onImageOpenShowImageInlineBefore( $this, $out );
379 if ( $this->displayImg->allowInlineDisplay() ) {
381 # "Download high res version" link below the image
382 # $msgsize = $this->getContext()->msg( 'file-info-size', $width_orig, $height_orig,
383 # Language::formatSize( $this->displayImg->getSize() ), $mime )->escaped();
384 # We'll show a thumbnail of this image
385 if ( $width > $maxWidth ||
386 $height > $maxHeight ||
387 $this->displayImg->isVectorized()
389 list( $width, $height ) = $this->displayImg->getDisplayWidthHeight(
390 $maxWidth, $maxHeight, $page
392 $linktext = $this->
getContext()->msg(
'show-big-image' )->escaped();
394 $thumbSizes = $this->
getThumbSizes( $width_orig, $height_orig );
395 # Generate thumbnails or thumbnail links as needed...
397 foreach ( $thumbSizes as $size ) {
406 if ( ( ( $size[0] <= $width_orig && $size[1] <= $height_orig )
407 || ( $this->displayImg->isVectorized()
410 && $size[0] != $width && $size[1] != $height
411 && $size[0] != $maxWidth && $size[1] != $maxHeight
413 $sizeLink = $this->
makeSizeLink( $params, $size[0], $size[1] );
415 $otherSizes[] = $sizeLink;
419 $otherSizes = array_unique( $otherSizes );
421 $sizeLinkBigImagePreview = $this->
makeSizeLink( $params, $width, $height );
423 if ( count( $otherSizes ) ) {
427 [
'class' =>
'mw-filepage-other-resolutions' ],
428 $this->
getContext()->msg(
'show-big-image-other' )
429 ->rawParams(
$lang->pipeList( $otherSizes ) )
430 ->params( count( $otherSizes ) )
434 } elseif ( $width == 0 && $height == 0 ) {
435 # Some sort of audio file that doesn't have dimensions
436 # Don't output a no hi res message for such a file
439 # Image is small enough to show full size on image page
440 $msgsmall = $this->
getContext()->msg(
'file-nohires' )->parse();
443 $params[
'width'] = $width;
444 $params[
'height'] = $height;
447 $params[
'imagePageParams'] = $request->getQueryValuesOnly();
448 $thumbnail = $this->displayImg->transform( $params );
451 $anchorclose = Html::rawElement(
453 [
'class' =>
'mw-filepage-resolutioninfo' ],
457 $isMulti = $this->displayImg->isMultipage() && $this->displayImg->pageCount() > 1;
459 $out->addModules(
'mediawiki.page.image.pagination' );
460 $out->addHTML(
'<table class="multipageimage"><tr><td>' );
465 'alt' => $this->displayImg->getTitle()->getPrefixedText(),
471 [
'class' =>
'fullImageLink',
'id' =>
'file' ],
472 $thumbnail->toHtml( $options ) . $anchorclose
478 $count = $this->displayImg->pageCount();
479 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
482 $label = $this->
getContext()->msg(
'imgmultipageprev' )->text();
489 [
'page' => $page - 1 ]
498 [
'page' => $page - 1 ]
504 if ( $page < $count ) {
505 $label = $this->
getContext()->msg(
'imgmultipagenext' )->text();
510 [
'page' => $page + 1 ]
519 [
'page' => $page + 1 ]
528 'name' =>
'pageselector',
532 for ( $i = 1; $i <= $count; $i++ ) {
533 $options[] = Xml::option(
$lang->formatNum( $i ), $i, $i == $page );
535 $select = Xml::tags(
'select',
536 [
'id' =>
'pageselector',
'name' =>
'page' ],
537 implode(
"\n", $options ) );
540 '</td><td><div class="multipageimagenavbox">' .
541 Xml::openElement(
'form', $formParams ) .
542 Html::hidden(
'title', $this->
getTitle()->getPrefixedDBkey() ) .
543 $this->
getContext()->msg(
'imgmultigoto' )->rawParams( $select )->parse() .
544 $this->
getContext()->msg(
'word-separator' )->escaped() .
545 Xml::submitButton( $this->
getContext()->msg(
'imgmultigo' )->text() ) .
546 Xml::closeElement(
'form' ) .
547 "<hr />$thumb1\n$thumb2<br style=\"clear: both\" /></div></td></tr></table>"
550 } elseif ( $this->displayImg->isSafeFile() ) {
551 # if direct link is allowed but it's not a renderable image, show an icon.
552 $icon = $this->displayImg->iconThumb();
557 [
'class' =>
'fullImageLink',
'id' =>
'file' ],
558 $icon->toHtml( [
'file-link' =>
true ] )
563 $longDesc = $this->
getContext()->msg(
'parentheses', $this->displayImg->getLongDesc() )->text();
565 $handler = $this->displayImg->getHandler();
569 $warningConfig = $handler->getWarningConfig( $this->displayImg );
571 if ( $warningConfig !==
null ) {
575 $output->addJsConfigVars(
'wgFileWarning', $warningConfig );
576 $output->addModules( $warningConfig[
'module'] );
577 $output->addModules(
'mediawiki.filewarning' );
581 $medialink =
"[[Media:$filename|$linktext]]";
583 if ( !$this->displayImg->isSafeFile() ) {
584 $warning = $this->
getContext()->msg(
'mediawarning' )->plain();
593 $out->wrapWikiTextAsInterface(
'fullMedia', <<<EOT
594<span
class=
"dangerousLink">{$medialink}</span> $dirmark<span
class=
"fileInfo">$longDesc</span>
598 $out->wrapWikiTextAsInterface(
'mediaWarning', $warning );
600 $out->wrapWikiTextAsInterface(
'fullMedia', <<<EOT
601{$medialink} {$dirmark}<span
class=
"fileInfo">$longDesc</span>
606 $renderLangOptions = $this->displayImg->getAvailableLanguages();
607 if ( count( $renderLangOptions ) >= 1 ) {
608 $out->addHTML( $this->
doRenderLangOpt( $renderLangOptions, $renderLang ) );
612 if ( !$this->displayImg->canAnimateThumbIfAppropriate() ) {
618 $ext = $this->displayImg->getExtension();
620 'file-no-thumb-animation-' .
$ext,
621 'file-no-thumb-animation'
624 $out->wrapWikiTextAsInterface(
'mw-noanimatethumb', $noAnimMesg );
627 if ( !$this->displayImg->isLocal() ) {
631 # Image does not exist
632 if ( !$this->
getPage()->getId() ) {
635 # No article exists either
636 # Show deletion log to be consistent with normal articles
637 LogEventsList::showLogExtract(
639 [
'delete',
'move',
'protect' ],
640 $this->
getTitle()->getPrefixedText(),
643 'conds' => [
'log_action != ' .
$dbr->addQuotes(
'revision' ) ],
644 'showIfEmpty' =>
false,
645 'msgKey' => [
'moveddeleted-notice' ]
656 'filepage-nofile-link',
657 $uploadTitle->getFullURL( [
658 'wpDestFile' => $this->
getFile()->getName()
662 $nofile =
'filepage-nofile';
667 $out->setRobotPolicy(
'noindex,nofollow' );
668 $out->wrapWikiMsg(
"<div id='mw-imagepage-nofile' class='plainlinks'>\n$1\n</div>", $nofile );
672 $request->response()->statusHeader( 404 );
675 $out->setFileVersion( $this->displayImg );
686 if ( $sizeLinkBigImagePreview ) {
688 $previewTypeDiffers =
false;
689 $origExt = $thumbExt = $this->displayImg->getExtension();
690 if ( $this->displayImg->getHandler() ) {
691 $origMime = $this->displayImg->getMimeType();
692 $typeParams = $params;
693 $this->displayImg->getHandler()->normaliseParams( $this->displayImg, $typeParams );
694 list( $thumbExt, $thumbMime ) = $this->displayImg->getHandler()->getThumbType(
695 $origExt, $origMime, $typeParams );
696 if ( $thumbMime !== $origMime ) {
697 $previewTypeDiffers =
true;
700 if ( $previewTypeDiffers ) {
701 return $this->
getContext()->msg(
'show-big-image-preview-differ' )->
702 rawParams( $sizeLinkBigImagePreview )->
703 params( strtoupper( $origExt ) )->
704 params( strtoupper( $thumbExt ) )->
707 return $this->
getContext()->msg(
'show-big-image-preview' )->
708 rawParams( $sizeLinkBigImagePreview )->
724 $params[
'width'] = $width;
725 $params[
'height'] = $height;
726 $thumbnail = $this->displayImg->transform( $params );
727 if ( $thumbnail && !$thumbnail->isError() ) {
728 return Html::rawElement(
'a', [
729 'href' => $thumbnail->getUrl(),
730 'class' =>
'mw-thumbnail-link'
731 ], $this->getContext()->msg(
'show-big-image-size' )->numParams(
732 $thumbnail->getWidth(), $thumbnail->getHeight()
746 $descUrl = $this->
getFile()->getDescriptionUrl();
747 $descText = $this->
getFile()->getDescriptionText( $this->
getContext()->getLanguage() );
750 if ( $descUrl && !$this->
getPage()->getId() ) {
751 $out->setCanonicalUrl( $descUrl );
754 $wrap =
"<div class=\"sharedUploadNotice\">\n$1\n</div>\n";
759 $this->
getContext()->msg(
'sharedupload-desc-here' )->plain() !==
'-'
761 $out->wrapWikiMsg( $wrap, [
'sharedupload-desc-here',
$repo, $descUrl ] );
762 } elseif ( $descUrl &&
763 $this->
getContext()->msg(
'sharedupload-desc-there' )->plain() !==
'-'
765 $out->wrapWikiMsg( $wrap, [
'sharedupload-desc-there',
$repo, $descUrl ] );
767 $out->wrapWikiMsg( $wrap, [
'sharedupload',
$repo ],
'' );
771 $this->mExtraDescription = $descText;
778 return $uploadTitle->getFullURL( [
779 'wpDestFile' => $this->
getFile()->getName(),
788 if ( !$this->
getContext()->getConfig()->
get(
'EnableUploads' ) ) {
797 $canUpload = $this->
getContext()->getAuthority()
798 ->probablyCan(
'upload', $this->
getTitle() );
799 if ( $canUpload && UploadBase::userCanReUpload(
806 $this->
getContext()->msg(
'uploadnewversion-linktext' )->text()
808 $attrs = [
'class' =>
'plainlinks',
'id' =>
'mw-imagepage-reupload-link' ];
809 $linkPara = Html::rawElement(
'p', $attrs, $ulink );
812 $attrs = [
'id' =>
'mw-imagepage-upload-disallowed' ];
813 $msg = $this->
getContext()->msg(
'upload-disallowed-here' )->text();
814 $linkPara = Html::element(
'p', $attrs, $msg );
817 $uploadLinks = Html::rawElement(
'div', [
'class' =>
'mw-imagepage-upload-links' ], $linkPara );
818 $this->
getContext()->getOutput()->addHTML( $uploadLinks );
836 MediaWikiServices::getInstance()->getLinkBatchFactory()
838 $out->addHTML( $pager->getBody() );
839 $out->preventClickjacking( $pager->getPreventClickjacking() );
841 $this->
getFile()->resetHistory();
843 # Exist check because we don't want to show this on pages where an image
844 # doesn't exist along with the noimage message, that would suck. -ævar
845 if ( $this->
getFile()->exists() ) {
859 [
'imagelinks',
'page' ],
860 [
'page_namespace',
'page_title',
'il_to' ],
861 [
'il_to' => $target,
'il_from = page_id' ],
863 [
'LIMIT' => $limit + 1,
'ORDER BY' =>
'il_from', ]
875 $redirects[$redir->getDBkey()] = [];
878 'page_title' => $redir->getDBkey(),
883 foreach (
$res as $row ) {
886 $count = count( $rows );
888 $hasMore = $count > $limit;
889 if ( !$hasMore && count( $redirects ) ) {
891 $limit - count( $rows ) + 1 );
892 foreach (
$res as $row ) {
893 $redirects[$row->il_to][] = $row;
896 $hasMore = (
$res->numRows() + count( $rows ) ) > $limit;
901 Html::rawElement(
'div',
902 [
'id' =>
'mw-imagepage-nolinkstoimage' ],
"\n$1\n" ),
908 $out->addHTML(
"<div id='mw-imagepage-section-linkstoimage'>\n" );
910 $out->addWikiMsg(
'linkstoimage', $count );
913 $out->addWikiMsg(
'linkstoimage-more',
914 $this->
getContext()->getLanguage()->formatNum( $limit ),
915 $this->
getTitle()->getPrefixedDBkey()
920 Html::openElement(
'ul',
921 [
'class' =>
'mw-imagepage-linkstoimage' ] ) .
"\n"
924 usort( $rows, [ $this,
'compare' ] );
926 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
930 foreach ( $rows as $element ) {
932 if ( $currentCount > $limit ) {
937 # Add a redirect=no to make redirect pages reachable
938 if ( isset( $redirects[$element->page_title] ) ) {
939 $query[
'redirect'] =
'no';
942 Title::makeTitle( $element->page_namespace, $element->page_title ),
945 if ( !isset( $redirects[$element->page_title] ) ) {
948 } elseif ( count( $redirects[$element->page_title] ) === 0 ) {
949 # Redirect without usages
950 $liContents = $this->
getContext()->msg(
'linkstoimage-redirect' )
951 ->rawParams( $link,
'' )
954 # Redirect with usages
956 foreach ( $redirects[$element->page_title] as $row ) {
958 if ( $currentCount > $limit ) {
963 Title::makeTitle( $row->page_namespace, $row->page_title ) );
964 $li .= Html::rawElement(
966 [
'class' =>
'mw-imagepage-linkstoimage-ns' . $element->page_namespace ],
971 $ul = Html::rawElement(
973 [
'class' =>
'mw-imagepage-redirectstofile' ],
976 $liContents = $this->
getContext()->msg(
'linkstoimage-redirect' )->rawParams(
977 $link, $ul )->parse();
979 $out->addHTML( Html::rawElement(
981 [
'class' =>
'mw-imagepage-linkstoimage-ns' . $element->page_namespace ],
987 $out->addHTML( Html::closeElement(
'ul' ) .
"\n" );
991 if ( $currentCount > $limit ) {
992 $out->addWikiMsg(
'morelinkstoimage', $this->
getTitle()->getPrefixedDBkey() );
994 $out->addHTML( Html::closeElement(
'div' ) .
"\n" );
1001 $dupes = $this->
getPage()->getDuplicates();
1002 if ( count( $dupes ) == 0 ) {
1006 $out->addHTML(
"<div id='mw-imagepage-section-duplicates'>\n" );
1007 $out->addWikiMsg(
'duplicatesoffile',
1008 $this->
getContext()->getLanguage()->formatNum( count( $dupes ) ), $this->
getTitle()->getDBkey()
1010 $out->addHTML(
"<ul class='mw-imagepage-duplicates'>\n" );
1012 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
1017 foreach ( $dupes as
$file ) {
1019 if (
$file->isLocal() ) {
1023 $file->getTitle()->getPrefixedText() );
1026 $file->getRepo()->getDisplayName()
1029 $out->addHTML(
"<li>{$link} {$fromSrc}</li>\n" );
1031 $out->addHTML(
"</ul></div>\n" );
1041 $out->setPageTitle( $this->
getContext()->msg(
'internalerror' ) );
1042 $out->setRobotPolicy(
'noindex,nofollow' );
1043 $out->setArticleRelated(
false );
1044 $out->enableClientCache(
false );
1045 $out->addWikiTextAsInterface( $description );
1057 return $a->page_namespace <=> $b->page_namespace
1058 ?: strcmp( $a->page_title, $b->page_title );
1071 return MediaFileTrait::getImageLimitsFromOption( $user, $optionName );
1085 $matchedRenderLang = $this->displayImg->getMatchedLanguage( $renderLang );
1087 foreach ( $langChoices as
$lang ) {
1090 $matchedRenderLang ===
$lang
1098 $this->
getContext()->msg(
'img-lang-default' )->text(),
1100 $matchedRenderLang ===
null
1103 $select = Html::rawElement(
1105 [
'id' =>
'mw-imglangselector',
'name' =>
'lang' ],
1108 $submit = Xml::submitButton( $this->
getContext()->msg(
'img-lang-go' )->text() );
1110 $formContents = $this->
getContext()->msg(
'img-lang-info' )
1111 ->rawParams( $select, $submit )
1113 $formContents .= Html::hidden(
'title', $this->
getTitle()->getPrefixedDBkey() );
1115 $langSelectLine = Html::rawElement(
'div', [
'id' =>
'mw-imglangselector-line' ],
1116 Html::rawElement(
'form', [
'action' =>
$wgScript ], $formContents )
1118 return $langSelectLine;
1127 $code = LanguageCode::bcp47(
$lang );
1128 $name = MediaWikiServices::getInstance()
1129 ->getLanguageNameUtils()
1130 ->getLanguageName( $code, $this->
getContext()->getLanguage()->getCode() );
1131 if ( $name !==
'' ) {
1132 $display = $this->
getContext()->msg(
'img-lang-opt', $code, $name )->text();
1155 if ( $this->displayImg->getRepo()->canTransformVia404() ) {
1163 $thumbSizes[] = [ $origWidth, $origHeight ];
1165 # Creating thumb links triggers thumbnail generation.
1166 # Just generate the thumb for the current users prefs.
1170 if ( !$this->displayImg->mustRender() ) {
1173 $thumbSizes[] = [ $origWidth, $origHeight ];
1184 return $this->
getPage()->getFile();
1192 return $this->
getPage()->isLocal();
1200 return $this->
getPage()->getDuplicates();
1208 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.
string false $mExtraDescription
Guaranteed to be HTML, {.
makeSizeLink( $params, $width, $height)
Creates an thumbnail of specified size and returns an HTML link to it.
File false $displayImg
Only temporary false, most code can assume this is a File.
getImageLimitsFromOption(UserIdentity $user, $optionName)
Returns the corresponding $wgImageLimits entry for the selected user option.
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.
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=null, $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.
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 text string and partially normalized it.
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