function _webform_render_fieldset in Webform 5
Same name and namespace in other branches
- 5.2 components/fieldset.inc \_webform_render_fieldset()
- 6.3 components/fieldset.inc \_webform_render_fieldset()
- 6.2 components/fieldset.inc \_webform_render_fieldset()
- 7.4 components/fieldset.inc \_webform_render_fieldset()
- 7.3 components/fieldset.inc \_webform_render_fieldset()
Build a form item array containing all the properties of this component.
Parameters
$component: An array of information describing the component, directly correlating to the webform_component database schema.
Return value
An array of a form item to be displayed on the client-side webform.
1 call to _webform_render_fieldset()
- _webform_submission_display_fieldset in components/
fieldset.inc - Display the result of a fieldset submission. The output of this function will be displayed under the "results" tab then "submissions".
File
- components/
fieldset.inc, line 39
Code
function _webform_render_fieldset($component) {
$form_item = array(
'#type' => $component['type'],
'#title' => htmlspecialchars($component['name'], ENT_QUOTES),
'#weight' => $component['weight'],
'#description' => _webform_filtervalues($component['extra']['description']),
'#collapsible' => $component['extra']['collapsible'],
'#collapsed' => $component['extra']['collapsed'],
'#attributes' => array(
"class" => "webform-component-" . $component['type'],
"id" => "webform-component-" . $component['form_key'],
),
);
// Change the 'width' option to the correct 'size' option.
if ($component['extra']['width'] > 0) {
$form_item['#size'] = $component['extra']['width'];
}
return $form_item;
}