function _webform_edit_textarea in Webform 5
Same name and namespace in other branches
- 5.2 components/textarea.inc \_webform_edit_textarea()
- 6.3 components/textarea.inc \_webform_edit_textarea()
- 6.2 components/textarea.inc \_webform_edit_textarea()
- 7.4 components/textarea.inc \_webform_edit_textarea()
- 7.3 components/textarea.inc \_webform_edit_textarea()
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/
textarea.inc, line 11
Code
function _webform_edit_textarea($currfield) {
$edit_fields = array();
$edit_fields['value'] = array(
'#type' => 'textarea',
'#title' => t("Default value"),
'#default_value' => $currfield['default'],
'#description' => t('The default value of the field.') . '<br />' . webform_help('webform/helptext#variables'),
'#cols' => 60,
'#rows' => 5,
'#weight' => 0,
);
$edit_fields['extra']['cols'] = array(
'#type' => 'textfield',
'#title' => t("Width"),
'#default_value' => $currfield['extra']['cols'],
'#description' => t('Width of the textfield.'),
'#size' => 5,
'#maxlength' => 10,
);
$edit_fields['extra']['rows'] = array(
'#type' => 'textfield',
'#title' => t("Height"),
'#default_value' => $currfield['extra']['rows'],
'#description' => t('Height of the textfield.'),
'#size' => 5,
'#maxlength' => 10,
);
$edit_fields['extra']['attributes']['disabled'] = array(
'#type' => 'checkbox',
'#title' => t("Disabled"),
'#return_value' => 'disabled',
'#description' => t('Make this field non-editable. Useful for setting an unchangeable default value.'),
'#weight' => 3,
'#default_value' => $currfield['extra']['attributes']['disabled'],
);
return $edit_fields;
}