First of all, prefs will be accessed the same way they always have been: $S->pref('prefname') or $S->{prefs}->{prefname} (the latter is the old way; the former is the preferred way.)
'prefname' will be arbitrary and set by the admin via a new admin tool. All of the current preferences will be converted and will keep the same names.
A good chunk of the user table (sig, displayed email, homepage, bio, etc) will be moved to prefs. They are already loaded into $S->{prefs} so there will be little external difference. This is so what is displayed on the user info page can be customized... the PGP key can be removed, and new fields more appropriate to the site's audience can be added. (I know I'm not the only one who wants to get rid of the PGP key field!)
Each pref will have a name and a number of properties, all set via the prefs admin tool. The user can only set the preference value.
- name The name of the preference as used in $S->pref('prefname')
- title The display name of the preference
- description A short description which will be displayed on the user preference page(s) giving the user information on what the preference does
- long description a more comprehensive description the user can access by clicking some sort of "help?" link by the preference, if there is a long description
- public Whether or not the preference is displayed on the user info page. Most preferences will not be public, because they are for configuration, not display
- html Whether or not HTML is allowed in the field value
- perm The permission the user must have in order to use this preference - blank for always on (eg, if the user doesn't have permission to use spellcheck, choosing the preferred spelling variant makes no sense)
- var The site control (var) that must be true in order for anybody to use this preference - blank for always on (eg, if the site does not use spellcheck at all, it makes no sense to offer the user the choice of a spelling variant)
- default The default value for this pref. This will replace a number of existing vars that set defaults
- length the maximum number of characters a user is allowed to put into this field
- regex a regex the user's input is tested against for validity. Blank to allow anything (the input is still quoted for database safety)
- page Which "preferences page" the info will show up on. Like var and block categories, simply putting a nonexistant page name in this field and saving the pref is sufficient to create a new prefs page
- field The HTML that will create the form element the user will use to set the preference. The form element must use as its "name" the name of the pref. Any HTML is acceptable here, including calls to boxes for more complex form elements such as drop-down lists with the current pref selected. The special key *value* will be filled with the user's current choice, or the default value if the user has not set this preference
- order What order the preference is shown on a given prefs page. If two preferences have the same order number they will be displayed in whatever order the database returns them in.
- template Which block to use to format this particular pref on the user pref pages. (Like box templates.)
It will be very easy for developers to add a new preference for a new feature. Adding a preference will be as simple as a single insert statement into the database, then the preference can be used just like all the pre-existing preferences in whatever code or box the new feature uses.
The preferences page layout will be moved to a block, so the admin can customize the layout. The different preference page paths will be consolidated, so that they are all accessed via /user/nickname/prefs/pagename (or /my/prefs/pagename) with pagename defaulting to "info" for what is now the preferences displayed on the user info page.
The only preferences that will remain hard-wired into the system are the "real email" and "new password" fields, both currently displayed as "protected settings" on the user prefs page. Their display, however, will be moved to a block (and probably their own preferences page).