MediaWiki
master
|
Factory class to create Skin objects. More...
Public Member Functions | |
__construct (ObjectFactory $objectFactory, array $skipSkins) | |
getAllowedSkins () | |
Get the list of user-selectable skins. More... | |
getInstalledSkins () | |
Get the list of installed skins. More... | |
getSkinNames () | |
Return an associative array of skin name => human readable name . More... | |
getSkinOptions (string $name) | |
Return options provided for a given skin name. More... | |
makeSkin ( $name) | |
Create a given Skin using the registered callback for $name. More... | |
register ( $name, $displayName, $spec, bool $skippable=null) | |
Register a new skin. More... | |
Private Attributes | |
array | $displayNames = [] |
Map of name => fallback human-readable name, used when the 'skinname-<skin>' message is not available. More... | |
array< string, array|callable > | $factoryFunctions = [] |
Map of skin name to object factory spec or factory function. More... | |
ObjectFactory | $objectFactory |
array< string, int > | $skipSkins |
Array of skins that should not be presented in the list of available skins in user preferences, while they're still installed. More... | |
const | SKIP_BY_REGISTER = 2 |
const | SKIP_BY_SITECONFIG = 1 |
SkinFactory::__construct | ( | ObjectFactory | $objectFactory, |
array | $skipSkins | ||
) |
ObjectFactory | $objectFactory | |
string[] | $skipSkins |
Definition at line 67 of file SkinFactory.php.
References $objectFactory, and $skipSkins.
SkinFactory::getAllowedSkins | ( | ) |
Get the list of user-selectable skins.
Useful for Special:Preferences and other places where you only want to show skins users can select from preferences page, thus excluding those as configured by $wgSkipSkins.
Definition at line 155 of file SkinFactory.php.
References getInstalledSkins().
SkinFactory::getInstalledSkins | ( | ) |
Get the list of installed skins.
Returns an associative array of skin name => human readable name
Definition at line 173 of file SkinFactory.php.
References $displayNames.
Referenced by getAllowedSkins().
SkinFactory::getSkinNames | ( | ) |
Return an associative array of skin name => human readable name
.
Definition at line 120 of file SkinFactory.php.
References $displayNames.
SkinFactory::getSkinOptions | ( | string | $name | ) |
Return options provided for a given skin name.
string | $name | Name of the skin you want options from |
Definition at line 184 of file SkinFactory.php.
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 131 of file SkinFactory.php.
SkinFactory::register | ( | $name, | |
$displayName, | |||
$spec, | |||
bool | $skippable = null |
||
) |
Register a new skin.
This will replace any previously registered skin by the same name.
string | $name | Internal skin name. See also Skin::__construct. |
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 | ObjectFactory spec to construct a Skin object, or callback that takes a skin name and returns a Skin object. See Skin::__construct for the constructor arguments. |
true | null | $skippable | Whether the skin is skippable and should be hidden from user preferences. By default, this is determined based by $wgSkipSkins. |
Definition at line 87 of file SkinFactory.php.
References SKIP_BY_REGISTER.
|
private |
Map of name => fallback human-readable name, used when the 'skinname-<skin>' message is not available.
Definition at line 47 of file SkinFactory.php.
Referenced by getInstalledSkins(), and getSkinNames().
|
private |
Map of skin name to object factory spec or factory function.
Definition at line 40 of file SkinFactory.php.
|
private |
Definition at line 51 of file SkinFactory.php.
Referenced by __construct().
|
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 59 of file SkinFactory.php.
Referenced by __construct().
|
private |
Definition at line 33 of file SkinFactory.php.
Referenced by register().
|
private |
Definition at line 32 of file SkinFactory.php.