PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm2 » Bug #6421

Allow control of all elements' persist freeze through freeze()

Details

Request #6421Allow control of all elements' persist freeze through freeze()
Submitted2006-01-05 23:22 UTC
Fromnigel at catalyst dot net dot nz
Assignedavb
StatusClosed
PackageHTML_QuickForm2
PHP Version4.4.0
OSDebian GNU/Linux
Roadmaps0.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.