to the repository.
What it does is let you add a "-mode display" switch to your form,
in which case it'll be displayed in "display" mode, meaning that
instead of an input/select/whatever widget, the value is displayed
in straight HTML. You can also set "-mode edit" or "-mode display"
on each individual element in a form, thus overruling the default
for the form.
I developed it for a client project, but it's also very useful for
applications like the bug-tracker (http://clients.museatech.net/bug-
tracker/), where I like to display the bug form with different
fields enabled, depending on the action you're taking.
It's better than using inform widgets (which is what I did for bug-
tracker) because it's annoying when you have a select widget where
the value isn't the same as the label. The enhancements I've made
changes each widget to display itself differently depending on
whether it's in display or edit mode.
Another small change is the ability to add control the number, name,
and labels on the buttons below the form, instead of only having one
with a hard-coded label of "submit". You do this by saying "-buttons
{ { "OK" ok } { "Cancel" cancel } }" when you create the form. If
you don't say -buttons, the default submit button will be created.
This is useful if you like the OK Cancel convention that I happen to
like. Or if you need more buttons as in the bug-tracker (Edit,
Resolve, Close, Reopen, etc.). Handling what happens when you click
those other buttons is entirely up to you and how you handle your
form submits.
This touches a lot of places in the form builder code, so there
might be unintended side-effects that I didn't test for, e.g. with
dotLRN, or with Don's ad_form stuff.
The question is: Any objections to me committing this now? Should I
wait a bit to not obstruct any development efforts going on? Or will
you be able to handle it allright? I know, we're using a version
control system, but it's always annoying when things inadvertently
break (not that I think they will) :)
Gimme the word, and if I don't hear back soon, I'll commit it.
/Lars
Request notifications