You are here

function _webform_render_date in Webform 5.2

Same name and namespace in other branches
  1. 5 components/date.inc \_webform_render_date()
  2. 6.3 components/date.inc \_webform_render_date()
  3. 6.2 components/date.inc \_webform_render_date()
  4. 7.4 components/date.inc \_webform_render_date()
  5. 7.3 components/date.inc \_webform_render_date()

Build a form item array containing all the properties of this component.

Parameters

$component: An array of information describing the component, directly correlating to the webform_component database schema.

Return value

An array of a form item to be displayed on the client-side webform.

1 call to _webform_render_date()
_webform_submission_display_date in components/date.inc
Display the result of a textfield submission. The output of this function will be displayed under the "results" tab then "submissions".

File

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

Code

function _webform_render_date($component) {
  $form_item = array(
    '#title' => $component['name'],
    '#weight' => $component['weight'],
    '#type' => 'date',
    '#description' => _webform_filter_descriptions($component['extra']['description']),
    '#prefix' => '<div class="webform-component-' . $component['type'] . '" id="webform-component-' . $component['form_key'] . '">',
    '#suffix' => '</div>',
    '#required' => $component['mandatory'],
    '#webform_component' => $component,
    '#process' => array(
      'webform_expand_date' => array(),
    ),
    '#validate' => array(
      'webform_validate_date' => array(
        $component,
      ),
    ),
  );
  return $form_item;
}