21 parent::initPage( $out );
30 $styleDirectory = $config->get( MainConfigNames::StyleDirectory );
32 $possibleSkins = scandir( $styleDirectory );
33 $possibleSkins = array_filter( $possibleSkins,
static function ( $maybeDir ) use ( $styleDirectory ) {
34 return $maybeDir !==
'.' && $maybeDir !==
'..' && is_dir(
"$styleDirectory/$maybeDir" );
38 $possibleSkins = array_filter( $possibleSkins,
static function ( $skinDir ) use ( $styleDirectory ) {
39 return is_file(
"$styleDirectory/$skinDir/skin.json" )
40 || is_file(
"$styleDirectory/$skinDir/$skinDir.php" );
43 return $possibleSkins;
53 $defaultSkin = $config->get( MainConfigNames::DefaultSkin );
55 $skinFactory = MediaWikiServices::getInstance()->getSkinFactory();
56 $enabledSkins = $skinFactory->getInstalledSkins();
57 $enabledSkins = array_change_key_case( $enabledSkins, CASE_LOWER );
59 if ( $installedSkins ) {
60 $skinsInstalledText = [];
61 $skinsInstalledSnippet = [];
63 foreach ( $installedSkins as $skinKey ) {
64 $normalizedKey = strtolower( $skinKey );
65 $isEnabled = array_key_exists( $normalizedKey, $enabledSkins );
67 $skinsInstalledText[] = $this->
msg(
'default-skin-not-found-row-enabled' )
68 ->params( $normalizedKey, $skinKey )->plain();
70 $skinsInstalledText[] = $this->
msg(
'default-skin-not-found-row-disabled' )
71 ->params( $normalizedKey, $skinKey )->plain();
76 return $this->
msg(
'default-skin-not-found' )->params(
78 implode(
"\n", $skinsInstalledText ),
79 implode(
"\n", $skinsInstalledSnippet ) )->numParams(
80 count( $skinsInstalledText ),
81 count( $skinsInstalledSnippet )
84 return $this->
msg(
'default-skin-not-found-no-skins' )->params(
98 if ( file_exists(
"$IP/skins/$skin/skin.json" ) ) {
99 return "wfLoadSkin( '$skin' );";
101 return "require_once \"\$IP/skins/$skin/$skin.php\";";
116 $skinFactory = MediaWikiServices::getInstance()->getSkinFactory();
117 $data = parent::getTemplateData();
121 $skinFactory->getInstalledSkins()[$config->get( MainConfigNames::DefaultSkin )]
if(!defined( 'MEDIAWIKI')) if(ini_get( 'mbstring.func_overload')) if(!defined( 'MW_ENTRY_POINT')) global $IP
Environment checks.
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
static warningBox( $html, $className='')
Return a warning box.
A class containing constants representing the names of configuration variables.
This is one of the Core classes and should be read at least once by any new developers.
disableClientCache()
Force the page to send nocache headers.
SkinTemplate class for the fallback skin.
buildHelpfulInformationMessage()
Inform the user why they are seeing this skin.
static getSnippetForSkin( $skin)
Get the appropriate LocalSettings.php snippet to enable the given skin.
getTemplateData()
Adds an html-fallback-warning template to inform system administrators that their mediawiki skin is i...
initPage(OutputPage $out)
Generic template for use with Mustache templates.