You are here

function _webform_edit_hidden in Webform 7.3

Same name and namespace in other branches
  1. 5.2 components/hidden.inc \_webform_edit_hidden()
  2. 5 components/hidden.inc \_webform_edit_hidden()
  3. 6.3 components/hidden.inc \_webform_edit_hidden()
  4. 6.2 components/hidden.inc \_webform_edit_hidden()
  5. 7.4 components/hidden.inc \_webform_edit_hidden()

Implements _webform_edit_component().

File

components/hidden.inc, line 40
Webform module hidden component.

Code

function _webform_edit_hidden($component) {
  $form = array();
  $form['value'] = array(
    '#type' => 'textarea',
    '#title' => t('Default value'),
    '#default_value' => $component['value'],
    '#description' => t('The default value of the field.') . theme('webform_token_help'),
    '#cols' => 60,
    '#rows' => 5,
    '#weight' => 0,
  );
  $form['display']['hidden_type'] = array(
    '#type' => 'radios',
    '#options' => array(
      'value' => t('Secure value (allows use of all tokens)'),
      'hidden' => t('Hidden element (less secure, changeable via JavaScript)'),
    ),
    '#title' => t('Hidden type'),
    '#description' => t('Both types of hidden fields are not shown to end-users. Using a <em>Secure value</em> allows the use of <em>all tokens</em>, even for anonymous users.'),
    '#default_value' => $component['extra']['hidden_type'],
    '#parents' => array(
      'extra',
      'hidden_type',
    ),
  );
  return $form;
}