You are here

function _webform_edit_layout_box in Webform Layout 7.2

Same name and namespace in other branches
  1. 6 layout_box.inc \_webform_edit_layout_box()
  2. 7 layout_box.inc \_webform_edit_layout_box()

Implements _webform_edit_component().

File

./layout_box.inc, line 28
Webform module layout_box component.

Code

function _webform_edit_layout_box($component) {
  $form = array();
  $form['display']['align'] = array(
    '#type' => 'select',
    '#title' => t('Alignment'),
    '#default_value' => $component['extra']['align'],
    '#description' => t('Controls how elements are arranged in this container. Choose "horizontal" to create a row, or "equal width" to create a row with equal column widths. The "vertical" option can be used to make columns within a horizontal box.'),
    '#parents' => array(
      'extra',
      'align',
    ),
    '#options' => array(
      'horiz' => t('Horizontal'),
      'equal' => t('Equal Width'),
      'vert' => t('Vertical'),
    ),
  );

  // Hide name, it's never shown
  $form['name']['#type'] = 'value';

  // Hack - name is required by webform but we don't expose it to the user. Instead we'll replace it with the value of form_key.
  $form['name']['#value'] = 'box';
  return $form;
}