Manual:Hooks/GetPreferences/fr

Exemple
In :

In :



Onglets et sections
The  array key specifies which tab and section of  contains your preferences. If your  value is foo/bar, this means your preference will appear on the foo tab (named by system message  ) within the bar section (named by system message  ). If no such tab or section exists, it is created automatically.



Liste des onglets par défaut


Types supportés


Types apparents
Le type peut prendre diverses valeurs trouvées dans le tableau  du  fichier, incluant  ,  ,  , etc.

Most preferences are stored in the same format as is used by the HTMLFormField, but in the case of  a transformation should be carried out from a newline-separated list of usernames (which is what the form widget works with) and a newline-separated list of user IDs (which is what gets stored in the database). See the treatment of  (in core) or   (in ) for examples of this.

Floats
For  types, you can set   and , which will be validated on save.



Préférences d'API
Les préférences API utilisent le type. Elles ne sont pas affichées dans Special:Preferences. They are usually set via custom front-end interfaces that call the API.



Préférences par défaut
To set the default value for a preference (i.e. the value that is set for a new user that hasn't customized their preferences yet), add the setting to the global variable. Use the same key name as you use for $preferences in the hook.

Par ailleurs, si vous écrivez une extension, vous pouvez ajouter à la section DefaultUserOptions du fichier extensions.json.