You are here

function _webform_edit_markup in Webform 5.2

Same name and namespace in other branches
  1. 5 components/markup.inc \_webform_edit_markup()
  2. 6.3 components/markup.inc \_webform_edit_markup()
  3. 6.2 components/markup.inc \_webform_edit_markup()
  4. 7.4 components/markup.inc \_webform_edit_markup()
  5. 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 33
Webform module markup component.

Code

function _webform_edit_markup($currfield) {
  $edit_fields = array();
  $edit_fields['advanced']['mandatory'] = array();

  // Do not render the mandatory checkbox.
  $edit_fields['markup']['value'] = array(
    '#type' => 'textarea',
    '#title' => t('Value'),
    '#default_value' => $currfield['value'],
    '#description' => t('Markup allows you to enter custom HTML or PHP logic into your form.') . theme('webform_token_help'),
    '#weight' => -1,
    '#parents' => array(
      'value',
    ),
  );

  // Add the filter form.
  $edit_fields['markup']['format'] = filter_form($currfield['extra']['format'], 0, array(
    'extra',
    'format',
  ));

  // No description for markup.
  $edit_fields['extra']['description'] = array();
  return $edit_fields;
}