wiki:ProjectSpecificPrefs

Version 3 (modified by Nicolas, 16 years ago) (diff)

Get rid of 'click here' links (full list)

Project-specific preferences

You can provide users with a set of project-specific preferences, controlled via a web interface. These preferences are stored in XML, in a field of the user table. You determine the structure of this XML, and what it's used for. On the client, the XML is passed to your application in the APP_INIT_DATA structure.

Examples of project-specific preferences include:

  • Graphics preferences: e.g., color scheme.
  • Application selection: you can allow users to select which of your applications they will be sent work for.

The PHP code that allows users to edit their project-specific preferences is in html/project/project_specific_prefs.inc. When you create your project, this is initialized to sample code. To create your own project-specific preferences, edit this file (and keep it under SVN or CVS somewhere). The functions you must supply are:

  • project_specific_prefs_edit()
  • project_specific_prefs_parse_form()
  • project_specific_prefs_show()
  • project_specific_prefs_parse()

The sample code provides a working example.