--- /dev/null
+<?php
+/**
+ * Skin file for the fallback skin.
+ *
+ * The structure is copied from the example skin (mediawiki/skins/Example).
+ *
+ * @since 1.24
+ * @file
+ */
+
+/**
+ * SkinTemplate class for the fallback skin
+ */
+class SkinFallback extends SkinTemplate {
+ var $skinname = 'fallback', $template = 'SkinFallbackTemplate';
+
+ /**
+ * Add CSS via ResourceLoader
+ *
+ * @param $out OutputPage
+ */
+ function setupSkinUserCss( OutputPage $out ) {
+ parent::setupSkinUserCss( $out );
+ $out->addModuleStyles( 'mediawiki.skinning.interface' );
+ }
+}
+
+/**
+ * BaseTemplate class for the fallback skin
+ */
+class SkinFallbackTemplate extends BaseTemplate {
+ /**
+ * @return array
+ */
+ private function findInstalledSkins() {
+ global $wgStyleDirectory;
+
+ // Get all subdirectories which might contains skins
+ $possibleSkins = scandir( $wgStyleDirectory );
+ $possibleSkins = array_filter( $possibleSkins, function ( $maybeDir ) {
+ global $wgStyleDirectory;
+ return $maybeDir !== '.' && $maybeDir !== '..' && is_dir( "$wgStyleDirectory/$maybeDir" );
+ } );
+
+ // Only keep the ones that contain a .php file with the same name inside
+ $possibleSkins = array_filter( $possibleSkins, function ( $skinDir ) {
+ global $wgStyleDirectory;
+ return is_file( "$wgStyleDirectory/$skinDir/$skinDir.php" );
+ } );
+
+ return $possibleSkins;
+ }
+
+ /**
+ * Inform the user why they are seeing this skin.
+ *
+ * @return string
+ */
+ private function buildHelpfulInformationMessage() {
+ global $wgDefaultSkin, $wgValidSkinNames;
+
+ $installedSkins = $this->findInstalledSkins();
+ $enabledSkins = $wgValidSkinNames;
+ $enabledSkins = array_change_key_case( $enabledSkins, CASE_LOWER );
+
+ if ( $installedSkins ) {
+ $skinsInstalledText = array();
+ $skinsInstalledSnippet = array();
+
+ foreach ( $installedSkins as $skin ) {
+ $normalizedKey = strtolower( $skin );
+ $isEnabled = array_key_exists( $normalizedKey, $enabledSkins );
+ if ( $isEnabled ) {
+ $skinsInstalledText[] = $this->getMsg( 'default-skin-not-found-row-enabled' )
+ ->params( $normalizedKey, $skin )->plain();
+ } else {
+ $skinsInstalledText[] = $this->getMsg( 'default-skin-not-found-row-disabled' )
+ ->params( $normalizedKey, $skin )->plain();
+ $skinsInstalledSnippet[] = "require_once \"\$IP/skins/$skin/$skin.php\";";
+ }
+ }
+
+ return $this->getMsg( 'default-skin-not-found' )->params(
+ $wgDefaultSkin,
+ implode( "\n", $skinsInstalledText ),
+ implode( "\n", $skinsInstalledSnippet )
+ )->parseAsBlock();
+ } else {
+ return $this->getMsg( 'default-skin-not-found-no-skins' )->params(
+ $wgDefaultSkin
+ )->parseAsBlock();
+ }
+ }
+
+ /**
+ * Outputs the entire contents of the page. No navigation (other than search box), just the big
+ * warning message and page content.
+ */
+ public function execute() {
+ $this->html( 'headelement' ) ?>
+
+ <div class="warningbox">
+ <?php echo $this->buildHelpfulInformationMessage() ?>
+ </div>
+
+ <form action="<?php $this->text( 'wgScript' ) ?>">
+ <input type="hidden" name="title" value="<?php $this->text( 'searchtitle' ) ?>" />
+ <h3><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h3>
+ <?php echo $this->makeSearchInput( array( "id" => "searchInput" ) ) ?>
+ <?php echo $this->makeSearchButton( 'go' ) ?>
+ </form>
+
+ <div class="mw-body" role="main">
+ <h1 class="firstHeading">
+ <span dir="auto"><?php $this->html( 'title' ) ?></span>
+ </h1>
+
+ <div class="mw-body-content">
+ <?php $this->html( 'bodytext' ) ?>
+ <?php $this->html( 'catlinks' ) ?>
+ </div>
+ </div>
+
+ <?php $this->printTrail() ?>
+ </body></html>
+
+ <?php
+ }
+}
"action-pagelang": "change the page language",
"log-name-pagelang": "Change language log",
"log-description-pagelang": "This is a log of changes in page languages.",
- "logentry-pagelang-pagelang": "$1 {{GENDER:$2|changed}} page language for $3 from $4 to $5."
+ "logentry-pagelang-pagelang": "$1 {{GENDER:$2|changed}} page language for $3 from $4 to $5.",
+ "default-skin-not-found": "Whoops! The default skin for your wiki (<code>$wgDefaultSkin</code>), <code>$1</code>, is not available.\n\nYour installation seems to include the following skins. See [https://www.mediawiki.org/wiki/Manual:Skin_configuration Manual: Skin configuration] for information how to enable them and choose the default.\n\n$2\n\n; If you have just installed MediaWiki:\n: You probably installed from git, or directly from the source code using some other method. This is expected.\n:* Try installing some skins from [https://www.mediawiki.org/wiki/Category:All_skins mediawiki.org's skin directory].\n:* Download the [https://www.mediawiki.org/wiki/Download tarball installer], which comes with several skins and extensions. You can copy and paste the <code>skins/</code> directory from it.\n: Doing this should not interfere with your git repository if you're a MediaWiki developer.\n\n; If you have just upgraded MediaWiki:\n: MediaWiki 1.24 and newer no longer automatically enables installed skins (see [https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery Manual: Skin autodiscovery]). You can paste the following lines into <code>LocalSettings.php</code> to enable all currently installed skins:\n\n<pre>$3</pre>\n\n; If you have just modified <code>LocalSettings.php</code>:\n: Double-check the skin names for typos.",
+ "default-skin-not-found-no-skins": "Whoops! The default skin for your wiki (<code>$wgDefaultSkin</code>), <code>$1</code>, is not available.\n\nYou have no installed skins.\n\n; If you have just installed MediaWiki:\n: You probably installed from git, or directly from the source code using some other method. This is expected.\n:* Try installing some skins from [https://www.mediawiki.org/wiki/Category:All_skins mediawiki.org's skin directory].\n:* Download the [https://www.mediawiki.org/wiki/Download tarball installer], which comes with several skins and extensions. You can copy and paste the <code>skins/</code> directory from it.\n: Doing this should not interfere with your git repository if you're a MediaWiki developer. See [https://www.mediawiki.org/wiki/Manual:Skin_configuration Manual: Skin configuration] for information how to enable skins and choose the default.\n",
+ "default-skin-not-found-row-enabled": "* <code>$1</code> / $2 (enabled)",
+ "default-skin-not-found-row-disabled": "* <code>$1</code> / $2 ('''disabled''')"
}
"action-pagelang": "{{Doc-action|pagelang}}",
"log-name-pagelang": "Display entry for log name for changes in page language in Special:Log.",
"log-description-pagelang": "Display description for log name for changes in page language in Special:Log.",
- "logentry-pagelang-pagelang": "{{Logentry}}\nAdditional parameters:\n* $4 - old language code, or \"[def]\" (hard-coded)\n* $5 - new language code, or \"[def]\" (hard-coded)"
+ "logentry-pagelang-pagelang": "{{Logentry}}\nAdditional parameters:\n* $4 - old language code, or \"[def]\" (hard-coded)\n* $5 - new language code, or \"[def]\" (hard-coded)",
+ "default-skin-not-found": "Message shown when the default skin for this MediaWiki installation can not be found.\n\nParameters:\n* $1: skin identifier for the default skin\n* $2: list of installed skins, composed using {{msg-mw|default-skin-not-found-row-enabled}} and {{msg-mw|default-skin-not-found-row-disabled}}\n* $3: code snippet to use to enable installed skins",
+ "default-skin-not-found-no-skins": "Message shown when the default skin for this MediaWiki installation can not be found and the installation has no skins at all.\n\nParameters:\n* $1: name of the default skin",
+ "default-skin-not-found-row-enabled": "One row of the list of installed skins shown as a part of {{msg-mw|default-skin-not-found}}, for an enabled skin.\n\nParameters:\n* $1: skin identifier\n$2: human-readable skin name",
+ "default-skin-not-found-row-disabled": "One row of the list of installed skins shown as a part of {{msg-mw|default-skin-not-found}}, for a disabled skin.\n\nParameters:\n* $1: skin identifier\n$2: human-readable skin name"
}