You are here

function _webform_edit_markup in Webform 7.4

Same name and namespace in other branches
  1. 5.2 components/markup.inc \_webform_edit_markup()
  2. 5 components/markup.inc \_webform_edit_markup()
  3. 6.3 components/markup.inc \_webform_edit_markup()
  4. 6.2 components/markup.inc \_webform_edit_markup()
  5. 7.3 components/markup.inc \_webform_edit_markup()

Implements _webform_edit_component().

File

components/markup.inc, line 41
Webform module markup component.

Code

function _webform_edit_markup($component) {
  $form = array();
  $form['value'] = array(
    '#type' => 'text_format',
    '#title' => t('Value'),
    '#default_value' => $component['value'],
    '#description' => t('Markup allows you to enter custom HTML into your form.') . ' ' . theme('webform_token_help', array(
      'groups' => array(
        'node',
        'submission',
      ),
    )),
    '#weight' => -1,
    '#format' => $component['extra']['format'],
    '#element_validate' => array(
      '_webform_edit_markup_validate',
    ),
  );
  $form['display']['display_on'] = array(
    '#type' => 'select',
    '#title' => t('Display on'),
    '#default_value' => $component['extra']['display_on'],
    '#options' => array(
      'form' => t('form only'),
      'display' => t('viewed submission only'),
      'both' => t('both form and viewed submission'),
    ),
    '#weight' => 1,
    '#parents' => array(
      'extra',
      'display_on',
    ),
  );
  return $form;
}