Merge "Replace Linker::link() with LinkRenderer"

This commit is contained in:
jenkins-bot 2017-03-23 16:53:14 +00:00 committed by Gerrit Code Review
commit fecdbf695e
3 changed files with 12 additions and 7 deletions

View file

@ -12,5 +12,5 @@ if ( function_exists( 'wfLoadExtension' ) ) {
); */
return true;
} else {
die( 'This version of the Gadgets extension requires MediaWiki 1.25+' );
die( 'This version of the Gadgets extension requires MediaWiki 1.28+' );
}

View file

@ -61,11 +61,13 @@ class SpecialGadgets extends SpecialPage {
? 'edit'
: 'viewsource';
$linkRenderer = $this->getLinkRenderer();
foreach ( $gadgets as $section => $entries ) {
if ( $section !== false && $section !== '' ) {
$t = Title::makeTitleSafe( NS_MEDIAWIKI, "Gadget-section-$section$langSuffix" );
$lnkTarget = $t
? Linker::link( $t, $this->msg( $editInterfaceMessage )->escaped(), [], [ 'action' => 'edit' ] )
? $linkRenderer->makeLink( $t, $this->msg( $editInterfaceMessage )->text(),
[], [ 'action' => 'edit' ] )
: htmlspecialchars( $section );
$lnk = "    [$lnkTarget]";
@ -90,15 +92,15 @@ class SpecialGadgets extends SpecialPage {
}
$links = [];
$links[] = Linker::link(
$links[] = $linkRenderer->makeLink(
$t,
$this->msg( $editInterfaceMessage )->escaped(),
$this->msg( $editInterfaceMessage )->text(),
[],
[ 'action' => 'edit' ]
);
$links[] = Linker::link(
$links[] = $linkRenderer->makeLink(
$this->getPageTitle( "export/{$name}" ),
$this->msg( 'gadgets-export' )->escaped()
$this->msg( 'gadgets-export' )->text()
);
$ttext = $this->msg( "gadget-{$name}" )->parse();
@ -132,7 +134,7 @@ class SpecialGadgets extends SpecialPage {
continue;
}
$lnk[] = Linker::link( $t, htmlspecialchars( $t->getText() ) );
$lnk[] = $linkRenderer->makeLink( $t, $t->getText() );
}
$output->addHTML( $lang->commaList( $lnk ) );
if ( $gadget->getLegacyScripts() ) {

View file

@ -7,6 +7,9 @@
"url": "https://www.mediawiki.org/wiki/Extension:Gadgets",
"descriptionmsg": "gadgets-desc",
"license-name": "GPL-2.0+",
"requires": {
"MediaWiki": ">= 1.28.0"
},
"type": "other",
"namespaces": [
{