mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-27 16:50:00 +00:00
Replace Linker::link() with LinkRenderer
This raises MediaWiki version requirement to 1.28.0. Bug: T149346 Change-Id: I90117382215c0e7962f2d4a4fa275898beab9816
This commit is contained in:
parent
f1ad65c724
commit
1d60e9f74f
|
@ -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+' );
|
||||
}
|
||||
|
|
|
@ -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() ) {
|
||||
|
|
|
@ -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": [
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue