So far the score is Formslib:1, MartinL: 0
Out in the wilderness of 1.5 I have a minor customisation to user/edit where if the user is of a particular kind (auth==='special plugin') the form does some special stuff with the email field. Students get free webmail if they want or if they choose an ext email address their emails are just sent there.
The special stuff looks like a series of radio-buttons, imagine the items below are radiobuttons:
- External email: [Textfield with your current email]
- Webmail address suggestion 1
- Webmail address suggestion 2
- Webmail address suggestion 3
- Or [type your desired name]@students.teo.ac.nz
So far so good. This was accomplished with a high-tech if() in user/edit.
Enter formslib... (cue eerie scary music)
After tracing a few levels of indirection, thanks to grep I finally found where the email field is defined (editlib.php:useredit_shared_definition()). But I don't see any practical way of customising this, and doing this inside this function would be wrong as it doesn't have the user data.
I am at a loss on 2 counts:
- I'd like to edit (and replace!) the email item of the form once the form object is instantiated and defined. Does formslib give me a means to address the field and change it?
- How do I create combined radio + textedit areas with formslib? This can be boiled down to the classic case of radio buttons with the last one saying other and letting you type your answer in.
Any hints on how user/edit is meant to be generally customised outside of the user_info fields?