Manual:$wgValidSkinNames

From mediawiki.org
This page is a translated version of the page Manual:$wgValidSkinNames and the translation is 61% complete.
拡張機能: $wgValidSkinNames
有効な外装名の一覧。利用できる外装がどれかを MediaWiki に伝えるために、外装の一部がこの変数を使用する場合がある。
導入されたバージョン:1.7.0 (r15226)
除去されたバージョン:使用中
許容される値:(array of lowercase skin names to either: ObjectFactory specifications; or to a string value which is the PHP class name when appended with Skin)
既定値:[]

詳細

有効な外装名についての情報の配列です。利用できる外装がどれかを MediaWiki に伝えるために使用される場合があります。

This variable can be used to register a skin, but it doesn't have to be. Skins can also be registered dynamically, by using the methods of the SkinFactory, namely SkinFactory::register(). This means there is no guarantee that $wgValidSkinNames actually is a complete list of the installed skins!
  • キーは、すべて小文字の外装 ID にしてください。 通常、これは skins/ フォルダー内の基底フォルダー名と同一にします。この基底フォルダーは、外装の css、リソースなどを含んでいます。
  • MediaWiki 1.35 未満では、値は先頭に「Skin」を付けると外装で実装しているクラスのクラス名になるような識別子にしてください。 つまり、外装のクラス名が「SkinFooBar」である場合、配列内の値は $wgValidSkinNames['foobar'] = 'FooBar'; です。
  • From MediaWiki 1.35, the value can be a specification for ObjectFactory . The old format, where the value is an identifier which when prefixed with "Skin" becomes the class name of the class implemented by your skin, is still supported.
  • MediaWiki 1.18 未満は、この値は表示名のフォールバックであり、小文字の外装名を ucfirst (訳注: 先頭を大文字化) したものをクラス名と見なしていました。 つまり、$wgValidSkinNames['foobar'] = 'FooBar'; の場合は、「SkinFoobar」クラスを読み込むことを試みました。 これには、MediaWiki の AutoLoader が大文字小文字を区別するのに対し、PHP のクラス名は大文字小文字が区別されない、という問題点がありました。

既定の外装は、あとで SkinFactory::getSkinNames() によって追加されます。 完全な一覧にアクセスしたい場合は、アクセス手段として SkinFactory::getSkinNames() を使用してください。

As of MediaWiki 1.35, the value is a specification for ObjectFactory . This allows for the skin name to be decoupled (such as PHP class namespacing) from the underlying PHP class name.

MediaWiki バージョン:
1.35

Old PHP loading style format:

$wgValidSkinNames["foobarskin"] = [
	"displayname" => "FooBarSkin",
	"class" => "MediaWiki\\Skins\\FooBar\\FooBarSkin"
];

skin.json format:

	"ValidSkinNames": {
		"foobarskin": {
			"class": "SkinMustache",
			"args": [
				{
					"@name": "key used for useskin=",
					"name": "foorbarskin",
					"@scripts": "List of ResourceLoader modules to be loaded",
					"scripts": [
						"skins.foo.js"
					],
					"@styles": "List of ResourceLoader style modules to be loaded",
					"styles": [
						"skins.foo.styles"
					],
					"@messages": "For skins that use SkinMustache, this will create translated template variables",
					"messages": [
						"foo-key"
					]
				}
			]
		}
	}