Home » HTML » HTML_QuickForm2 » Bug #6421
Allow control of all elements' persist freeze through freeze()
Details
| Request #6421 | Allow control of all elements' persist freeze through freeze() |
|---|---|
| Submitted | 2006-01-05 23:22 UTC |
| From | nigel at catalyst dot net dot nz |
| Assigned | avb |
| Status | Closed |
| Package | HTML_QuickForm2 |
| PHP Version | 4.4.0 |
| OS | Debian GNU/Linux |
| Roadmaps | 0.1.0 |
Comments
[2006-01-05 23:22 UTC] nigel at catalyst dot net dot nz
Description:
------------
I have made a couple of changes that allow you to use the second parameter of HTML_QuickForm::freeze() to set whether it is persistant or not.
That way people can easily say for all elements: I do _not_ want persistant freeze for _all_ elements, rather than calling it on all elements.
This is really useful with the smarty renderer, when you want to use one template/page for viewing and editing.
Test script:
---------------
$form =& new HTML_Quickform;
$foo =& $form->addElement(...);
$bar =& $form->addElement(...);
// more elements...
if (!$edit_mode) {
// We are not editing this time. We want to freeze the
// elements of the form and _not_ print out the hidden
// elements that contain the values
$form->freeze(null, false);
}
Expected result:
----------------
Only the values of all of the elements will be printed when they are rendered, _not_ the hidden elements (because we are using false for second parameter, true is the default).
[2006-01-05 23:24 UTC] nigel at catalyst dot net dot nz
I will send the patch or paste it here if you want this feature.