<?php
+
+use MediaWiki\MediaWikiServices;
+
/**
* Image gallery.
*
$lang = $this->getRenderLang();
# Output each image...
foreach ( $this->mImages as $pair ) {
+ // "text" means "caption" here
/** @var Title $nt */
- $nt = $pair[0];
- $text = $pair[1]; # "text" means "caption" here
- $alt = $pair[2];
- $link = $pair[3];
+ list( $nt, $text, $alt, $link ) = $pair;
$descQuery = false;
if ( $nt->getNamespace() === NS_FILE ) {
# Fetch and register the file (file title may be different via hooks)
list( $img, $nt ) = $this->mParser->fetchFileAndTitle( $nt, $options );
} else {
- $img = wfFindFile( $nt );
+ $img = MediaWikiServices::getInstance()->getRepoGroup()->findFile( $nt );
}
} else {
$img = false;
if ( $this->mParser instanceof Parser ) {
$this->mParser->addTrackingCategory( 'broken-file-category' );
}
- } elseif ( $this->mHideBadImages
- && wfIsBadImage( $nt->getDBkey(), $this->getContextTitle() )
+ } elseif ( $this->mHideBadImages && MediaWikiServices::getInstance()->getBadFileLookup()
+ ->isBadFile( $nt->getDBkey(), $this->getContextTitle() )
) {
# The image is blacklisted, just show it as a text link.
$thumbhtml = "\n\t\t\t" . '<div class="thumb" style="height: ' .
}
// @todo Code is incomplete.
- // $linkTarget = Title::newFromText( $wgContLang->getNsText( MWNamespace::getUser() ) .
- // ":{$ut}" );
+ // $linkTarget = Title::newFromText( MediaWikiServices::getInstance()->
+ // getContentLanguage()->getNsText( MediaWikiServices::getInstance()->
+ // getNamespaceInfo()->getUser() ) . ":{$ut}" );
// $ul = Linker::link( $linkTarget, $ut );
$meta = [];