You are here

function date_popup_element_process in Date 7

Same name and namespace in other branches
  1. 7.3 date_popup/date_popup.module \date_popup_element_process()
  2. 7.2 date_popup/date_popup.module \date_popup_element_process()

Javascript popup element processing. Add popup attributes to $element.

1 string reference to 'date_popup_element_process'
date_popup_element_info in date_popup/date_popup.module
Implement hook_element_info().

File

date_popup/date_popup.module, line 215
A module to enable jquery calendar and time entry popups. Requires the Date API.

Code

function date_popup_element_process($element, $form_state, $form) {
  date_popup_add();
  module_load_include('inc', 'date_api', 'date_api_elements');
  $element['#tree'] = TRUE;
  $element['#theme_wrappers'] = array(
    'date_popup',
  );
  $element['date'] = date_popup_process_date($element);
  $element['time'] = date_popup_process_time($element);
  if (isset($element['#element_validate'])) {
    array_push($element['#element_validate'], 'date_popup_validate');
  }
  else {
    $element['#element_validate'] = array(
      'date_popup_validate',
    );
  }
  return $element;
}