function _webform_edit_hidden in Webform 6.2
Same name and namespace in other branches
- 5.2 components/hidden.inc \_webform_edit_hidden()
- 5 components/hidden.inc \_webform_edit_hidden()
- 6.3 components/hidden.inc \_webform_edit_hidden()
- 7.4 components/hidden.inc \_webform_edit_hidden()
- 7.3 components/hidden.inc \_webform_edit_hidden()
Create a set of form items to be displayed on the form for editing this component. Use care naming the form items, as this correlates directly to the database schema. The component "Name" and "Description" fields are added to every component type and are not necessary to specify here (although they may be overridden if desired).
Return value
An array of form items to be displayed on the edit component page.
File
- components/
hidden.inc, line 33 - Webform module hidden component.
Code
function _webform_edit_hidden($currfield) {
$edit_fields = array();
$edit_fields['value'] = array(
'#type' => 'textarea',
'#title' => t('Default value'),
'#default_value' => $currfield['value'],
'#description' => t('The default value of the field.') . theme('webform_token_help'),
'#cols' => 60,
'#rows' => 5,
'#weight' => 0,
);
$edit_fields['advanced']['mandatory'] = array(
'#type' => 'hidden',
'#value' => 1,
);
$edit_fields['extra']['email'] = array(
'#type' => 'checkbox',
'#title' => t('E-mail a submission copy'),
'#return_value' => 1,
'#default_value' => $currfield['extra']['email'],
'#description' => t('Check this option if this component contains an e-mail address that should get a copy of the submission. Emails are sent individually so other emails will not be shown to the recipient.'),
);
$edit_fields['extra']['description'] = array();
// Hide the description box.
return $edit_fields;
}