MediaWiki REL1_37
|
Factory class to create Skin objects. More...
Public Member Functions | |
__construct (ObjectFactory $objectFactory, array $skipSkins) | |
getAllowedSkins () | |
Fetch the list of user-selectable skins in regards to $wgSkipSkins. | |
getSkinNames () | |
Returns an associative array of: skin name => human readable name. | |
makeSkin ( $name) | |
Create a given Skin using the registered callback for $name. | |
register ( $name, $displayName, $spec) | |
Register a new Skin factory function. | |
Private Attributes | |
array | $displayNames = [] |
Map of name => fallback human-readable name, used when the 'skinname-<skin>' message is not available. | |
array< string, array|callable > | $factoryFunctions = [] |
Map of skin name to object factory spec or factory function. | |
ObjectFactory | $objectFactory |
string[] | $skipSkins |
Array of skins that should not be presented in the list of available skins in user preferences, while they're still installed. | |
SkinFactory::__construct | ( | ObjectFactory | $objectFactory, |
array | $skipSkins | ||
) |
ObjectFactory | $objectFactory | |
string[] | $skipSkins |
Definition at line 65 of file SkinFactory.php.
SkinFactory::getAllowedSkins | ( | ) |
Fetch the list of user-selectable skins in regards to $wgSkipSkins.
Useful for Special:Preferences and other places where you only want to show skins users can use.
Definition at line 139 of file SkinFactory.php.
References getSkinNames().
SkinFactory::getSkinNames | ( | ) |
Returns an associative array of: skin name => human readable name.
Definition at line 107 of file SkinFactory.php.
Referenced by getAllowedSkins().
SkinFactory::makeSkin | ( | $name | ) |
Create a given Skin using the registered callback for $name.
string | $name | Name of the skin you want |
SkinException | If a factory function isn't registered for $name |
Definition at line 117 of file SkinFactory.php.
SkinFactory::register | ( | $name, | |
$displayName, | |||
$spec | |||
) |
Register a new Skin factory function.
Will override if it's already registered.
string | $name | Internal skin name. Should be all-lowercase (technically doesn't have to be, but doing so would change the case of i18n message keys). |
string | $displayName | For backwards-compatibility with old skin loading system. This is the text used as skin's human-readable name when the 'skinname-<skin>' message is not available. |
array | callable | $spec | Callback that takes the skin name as an argument, or object factory spec specifying how to create the skin |
InvalidArgumentException | If an invalid callback is provided |
Definition at line 84 of file SkinFactory.php.
|
private |
Map of name => fallback human-readable name, used when the 'skinname-<skin>' message is not available.
Definition at line 45 of file SkinFactory.php.
|
private |
Map of skin name to object factory spec or factory function.
Definition at line 38 of file SkinFactory.php.
|
private |
Definition at line 49 of file SkinFactory.php.
|
private |
Array of skins that should not be presented in the list of available skins in user preferences, while they're still installed.
Definition at line 57 of file SkinFactory.php.