X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FLinker.php;h=8682991bf83a9410335f5c7246e36d25604d5f40;hb=711fad668b86ff837a31808fe71056b9257e4d80;hp=21d87d8a974a097d60ff971fea8808eef8ab108f;hpb=b6ac6ab899cd9baaadfc41dc82b7c9bd8dd2d1bc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Linker.php b/includes/Linker.php index 21d87d8a97..8682991bf8 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1919,6 +1919,8 @@ class Linker { } /** + * @deprecated since 1.28, use TemplatesOnThisPageFormatter directly + * * Returns HTML for the "templates used on this page" list. * * Make an HTML list of templates, and then add a "More..." link at @@ -1937,87 +1939,24 @@ class Linker { public static function formatTemplates( $templates, $preview = false, $section = false, $more = null ) { - global $wgLang; - - $outText = ''; - if ( count( $templates ) > 0 ) { - # Do a batch existence check - $batch = new LinkBatch; - foreach ( $templates as $title ) { - $batch->addObj( $title ); - } - $batch->execute(); - - # Construct the HTML - $outText = '
'; - if ( $preview ) { - $outText .= wfMessage( 'templatesusedpreview' )->numParams( count( $templates ) ) - ->parseAsBlock(); - } elseif ( $section ) { - $outText .= wfMessage( 'templatesusedsection' )->numParams( count( $templates ) ) - ->parseAsBlock(); - } else { - $outText .= wfMessage( 'templatesused' )->numParams( count( $templates ) ) - ->parseAsBlock(); - } - $outText .= "
'; + if ( $more instanceof Message ) { + $more = $more->toString(); } - return $outText; + + $formatter = new TemplatesOnThisPageFormatter( + RequestContext::getMain(), + MediaWikiServices::getInstance()->getLinkRenderer() + ); + return $formatter->format( $templates, $type, $more ); } /**