usort( $wgExtensionCredits[$type], [ $this, 'compare' ] );
foreach ( $wgExtensionCredits[$type] as $extension ) {
- $out .= $this->getCreditsForExtension( $extension );
+ $out .= $this->getCreditsForExtension( $type, $extension );
}
}
* - Description of extension (descriptionmsg or description)
* - List of authors (author) and link to a ((AUTHORS)|(CREDITS))(\.txt)? file if it exists
*
+ * @param string $type Category name of the extension
* @param array $extension
*
* @return string Raw HTML
*/
- public function getCreditsForExtension( array $extension ) {
+ public function getCreditsForExtension( $type, array $extension ) {
$out = $this->getOutput();
// We must obtain the information for all the bits and pieces!
if ( isset( $extension['name'] ) ) {
$licenseName = null;
if ( isset( $extension['license-name'] ) ) {
- $licenseName = $out->parseInline( $extension['license-name'] );
+ $licenseName = new HtmlArmor( $out->parseInline( $extension['license-name'] ) );
} elseif ( $this->getExtLicenseFileName( $extensionPath ) ) {
- $licenseName = $this->msg( 'version-ext-license' )->escaped();
+ $licenseName = $this->msg( 'version-ext-license' )->text();
}
if ( $licenseName !== null ) {
- $licenseLink = Linker::link(
+ $licenseLink = $this->getLinkRenderer()->makeLink(
$this->getPageTitle( 'License/' . $extension['name'] ),
$licenseName,
[
// Finally! Create the table
$html = Html::openElement( 'tr', [
'class' => 'mw-version-ext',
- 'id' => Sanitizer::escapeId( 'mw-version-ext-' . $extension['name'] )
+ 'id' => Sanitizer::escapeId( 'mw-version-ext-' . $type . '-' . $extension['name'] )
]
);
*/
public function listAuthors( $authors, $extName, $extDir ) {
$hasOthers = false;
+ $linkRenderer = $this->getLinkRenderer();
$list = [];
foreach ( (array)$authors as $item ) {
$hasOthers = true;
if ( $extName && $this->getExtAuthorsFileName( $extDir ) ) {
- $text = Linker::link(
+ $text = $linkRenderer->makeLink(
$this->getPageTitle( "Credits/$extName" ),
- $this->msg( 'version-poweredby-others' )->escaped()
+ $this->msg( 'version-poweredby-others' )->text()
);
} else {
$text = $this->msg( 'version-poweredby-others' )->escaped();
}
if ( $extName && !$hasOthers && $this->getExtAuthorsFileName( $extDir ) ) {
- $list[] = $text = Linker::link(
+ $list[] = $text = $linkRenderer->makeLink(
$this->getPageTitle( "Credits/$extName" ),
- $this->msg( 'version-poweredby-others' )->escaped()
+ $this->msg( 'version-poweredby-others' )->text()
);
}