Jump to content

Manual:$wgSkipSkins

From mediawiki.org
This page is a translated version of the page Manual:$wgSkipSkins and the translation is 20% complete.
Apariencias: $wgSkipSkins
Specify the name of skins that should not be presented in the list of available skins.
Introducido en la versión:1.4.5
Eliminado en la versión:aún se usa
Valores permitidos:no especificado
Valor predeterminado:[]

Detalles

Specify the names of skins that should not be presented in the list of available skins.

This configuration option was needed to fix a design flaw: Skin autodiscovery made it so that MediaWiki automatically detected all skins from inside the skins/ folder and made them available. That way it was impossible to activate those skins as they were activated automatically. You could only later hide them again - that is what this option was there for initially. With MediaWiki 1.23, skin autodiscovery got deprecated. It's now used to support hiding internal or other custom skins not meant to be made available for general use. For instance the bespoke skin used by API documentation, which removes sidebar and most user elements, is hidden with this variable.

Use for preventing users from choosing one or more skins which you do not want to remove from the skins directory.

Ejemplo, en LocalSettings.php agrega:

# Remove skins from skin choice of user preferences
$wgSkipSkins = [
    'minerva',
    'monobook',
    'timeless'
];

Above would remove all skin choices but Vector. Omit from above array any choices that you want to remain.

Changing user preferences when removing a skin

In versions up to 1.16 (at most), upon registration the name of the default skin as provided by $wgDefaultSkin is copied to the user preferences of the user. When you later make this skin inaccessible, use the maintenance script Manual:UserOptions.php to make sure that this skin is also no longer chosen by any user:

php userOptions.php skin --old "monobook" --new "vector"

This will change the skin for all registered users, who have selected Monobook, to Vector.

Véase también