OK.. I am neither a Drupal or PHP wiz, but I have made some progress with the forms API, and form_alter, but I still cannot figure out how do this, and am hoping a drupal guru can solve it.
I want to put a div around only SOME of the form elements in the $form array.
Let's take for example the collapsing fieldsets used for various admin settings in many modules.
I have a "tweaks.module" where I can do a form_alter and modify individual forms and their child elements. That's pretty easy.
But I want to wrap N number of fieldsets (or other elements) in a div with a custom class in the many nodes that have settings.
So I need to know where and how I hook or hack the array of elements and add this parent container element. I think I can flag the elements I want in the set by settign a flag via form_alter like $form['title']['in_group'] = 'true' for each element i want to include in the set, but....
where would I then read these values and surround of them with HTML source that the rendering system/forms API won't choke on? And how?
What I want to end up with is:
<form id="some_form">
<div class="my-class">
<fieldset>
</fieldset>
<fieldset>
</fieldset>
</div>
<fieldset>
Not included in wrapped set
</fieldset>
</form>
Anyone have a strategy for this?
If I sound clueless, I largely am. Be gentle with me :)