You are here

function _webform_display_hidden in Webform 6.3

Same name and namespace in other branches
  1. 7.4 components/hidden.inc \_webform_display_hidden()
  2. 7.3 components/hidden.inc \_webform_display_hidden()

Implements _webform_display_component().

File

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

Code

function _webform_display_hidden($component, $value, $format = 'html') {
  $element = array(
    '#title' => $component['name'],
    '#value' => isset($value[0]) ? $value[0] : NULL,
    '#weight' => $component['weight'],
    '#format' => $format,
    '#theme' => 'webform_display_hidden',
    '#theme_wrappers' => $format == 'html' ? array(
      'webform_element',
      'webform_element_wrapper',
    ) : array(
      'webform_element_text',
    ),
    '#post_render' => array(
      'webform_element_wrapper',
    ),
    '#translatable' => array(
      'title',
    ),
  );
  return $element;
}