Remove usage of Skin::getSkinNames()

Bug: T257993
Change-Id: Icc945ce1e3287a3b25152702818e5b2a90232677
This commit is contained in:
Ammar Abdulhamid 2020-08-23 08:27:14 +01:00
parent 404b11c4d1
commit 146545919d

View file

@ -48,10 +48,12 @@ class SpecialGadgets extends SpecialPage {
return; return;
} }
$services = MediaWikiServices::getInstance();
$output->disallowUserJs(); $output->disallowUserJs();
$lang = $this->getLanguage(); $lang = $this->getLanguage();
$langSuffix = ""; $langSuffix = "";
if ( !$lang->equals( MediaWikiServices::getInstance()->getContentLanguage() ) ) { if ( !$lang->equals( $services->getContentLanguage() ) ) {
$langSuffix = "/" . $lang->getCode(); $langSuffix = "/" . $lang->getCode();
} }
@ -62,6 +64,7 @@ class SpecialGadgets extends SpecialPage {
: 'viewsource'; : 'viewsource';
$linkRenderer = $this->getLinkRenderer(); $linkRenderer = $this->getLinkRenderer();
$skinFactory = $services->getSkinFactory();
foreach ( $gadgets as $section => $entries ) { foreach ( $gadgets as $section => $entries ) {
if ( $section !== false && $section !== '' ) { if ( $section !== false && $section !== '' ) {
$t = Title::makeTitleSafe( NS_MEDIAWIKI, "Gadget-section-$section$langSuffix" ); $t = Title::makeTitleSafe( NS_MEDIAWIKI, "Gadget-section-$section$langSuffix" );
@ -183,7 +186,7 @@ class SpecialGadgets extends SpecialPage {
// $requiredSkins can be an array, or true (if all skins are supported) // $requiredSkins can be an array, or true (if all skins are supported)
if ( is_array( $requiredSkins ) ) { if ( is_array( $requiredSkins ) ) {
$skins = []; $skins = [];
$validskins = Skin::getSkinNames(); $validskins = $skinFactory->getSkinNames();
foreach ( $requiredSkins as $skinid ) { foreach ( $requiredSkins as $skinid ) {
if ( isset( $validskins[$skinid] ) ) { if ( isset( $validskins[$skinid] ) ) {
$skins[] = $this->msg( "skinname-$skinid" )->plain(); $skins[] = $this->msg( "skinname-$skinid" )->plain();