function _webform_edit_markup in Webform 5
Same name and namespace in other branches
- 5.2 components/markup.inc \_webform_edit_markup()
- 6.3 components/markup.inc \_webform_edit_markup()
- 6.2 components/markup.inc \_webform_edit_markup()
- 7.4 components/markup.inc \_webform_edit_markup()
- 7.3 components/markup.inc \_webform_edit_markup()
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/
markup.inc, line 11
Code
function _webform_edit_markup($currfield) {
$edit_fields = array();
$edit_fields['mandatory'] = array();
// Do not render the mandatory checkbox.
$edit_fields['value'] = array(
'#type' => 'textarea',
'#title' => t("Value"),
'#default_value' => $currfield['default'],
'#description' => t('Markup allows you to enter custom HTML or PHP logic into your form.') . '<br />' . webform_help('webform/helptext#variables'),
'#weight' => -1,
);
// Add the filter form.
$edit_fields['extra']['filter'] = filter_form($currfield['extra']['format'], 0, array(
'field',
'extra',
'format',
));
// No description for markup.
$edit_fields['extra']['description'] = array();
return $edit_fields;
}