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;
}
$services = MediaWikiServices::getInstance();
$output->disallowUserJs();
$lang = $this->getLanguage();
$langSuffix = "";
if ( !$lang->equals( MediaWikiServices::getInstance()->getContentLanguage() ) ) {
if ( !$lang->equals( $services->getContentLanguage() ) ) {
$langSuffix = "/" . $lang->getCode();
}
@ -62,6 +64,7 @@ class SpecialGadgets extends SpecialPage {
: 'viewsource';
$linkRenderer = $this->getLinkRenderer();
$skinFactory = $services->getSkinFactory();
foreach ( $gadgets as $section => $entries ) {
if ( $section !== false && $section !== '' ) {
$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)
if ( is_array( $requiredSkins ) ) {
$skins = [];
$validskins = Skin::getSkinNames();
$validskins = $skinFactory->getSkinNames();
foreach ( $requiredSkins as $skinid ) {
if ( isset( $validskins[$skinid] ) ) {
$skins[] = $this->msg( "skinname-$skinid" )->plain();