22 $styleDirectory = $this->config->get(
'StyleDirectory' );
24 $possibleSkins = scandir( $styleDirectory );
25 $possibleSkins = array_filter( $possibleSkins,
function ( $maybeDir ) use ( $styleDirectory ) {
26 return $maybeDir !==
'.' && $maybeDir !==
'..' && is_dir(
"$styleDirectory/$maybeDir" );
30 $possibleSkins = array_filter( $possibleSkins,
function ( $skinDir ) use ( $styleDirectory ) {
31 return is_file(
"$styleDirectory/$skinDir/skin.json" )
32 || is_file(
"$styleDirectory/$skinDir/$skinDir.php" );
35 return $possibleSkins;
44 $defaultSkin = $this->config->get(
'DefaultSkin' );
46 $skinFactory = MediaWikiServices::getInstance()->getSkinFactory();
47 $enabledSkins = $skinFactory->getSkinNames();
48 $enabledSkins = array_change_key_case( $enabledSkins, CASE_LOWER );
50 if ( $installedSkins ) {
51 $skinsInstalledText = [];
52 $skinsInstalledSnippet = [];
54 foreach ( $installedSkins as $skin ) {
55 $normalizedKey = strtolower( $skin );
56 $isEnabled = array_key_exists( $normalizedKey, $enabledSkins );
58 $skinsInstalledText[] = $this->
getMsg(
'default-skin-not-found-row-enabled' )
59 ->params( $normalizedKey, $skin )->plain();
61 $skinsInstalledText[] = $this->
getMsg(
'default-skin-not-found-row-disabled' )
62 ->params( $normalizedKey, $skin )->plain();
67 return $this->
getMsg(
'default-skin-not-found' )->params(
69 implode(
"\n", $skinsInstalledText ),
70 implode(
"\n", $skinsInstalledSnippet ) )->numParams(
71 count( $skinsInstalledText ),
72 count( $skinsInstalledSnippet )
75 return $this->
getMsg(
'default-skin-not-found-no-skins' )->params(
89 if ( file_exists(
"$IP/skins/$skin/skin.json" ) ) {
90 return "wfLoadSkin( '$skin' );";
92 return "require_once \"\$IP/skins/$skin/$skin.php\";";
101 $this->
html(
'headelement' );
104 <form action=
"<?php $this->text( 'wgScript' ) ?>">
105 <input type=
"hidden" name=
"title" value=
"<?php $this->text( 'searchtitle' ) ?>" />
106 <h3><label
for=
"searchInput"><?php $this->
msg(
'search' ) ?></label></h3>
111 <div
class=
"mw-body" role=
"main">
112 <h1
class=
"firstHeading"><?php $this->
html(
'title' ) ?></h1>
114 <div
class=
"mw-body-content">
115 <?php $this->
html(
'bodytext' ) ?>
116 <?php $this->
html(
'catlinks' ) ?>