You are here

function datex_element_info_alter in Datex 7.3

Same name and namespace in other branches
  1. 8 datex.module \datex_element_info_alter()
  2. 7.2 datex_date.inc \datex_element_info_alter()

Adds datex as a date form element validator.

File

./datex_date.inc, line 314
Provides support for date module.

Code

function datex_element_info_alter(&$elements) {
  if (isset($elements['date'])) {
    $el =& $elements['date_'];
    $validator = isset($el['#element_validate']) ? $el['#element_validate'] : [];
    $validator = array_merge([
      '_datex_date_field_element_validate_callback',
    ], $validator);
    $el['#element_validate'] = $validator;
  }
  if (isset($elements['date_select'])) {
    $el =& $elements['date_select'];
    $validator = isset($el['#element_validate']) ? $el['#element_validate'] : [];
    $validator = array_merge([
      '_datex_select_date_field_element_validate_callback',
    ], $validator);
    $el['#element_validate'] = $validator;
  }
  if (isset($elements['date_popup']) && module_exists('datex_popup')) {
    $el =& $elements['date_popup'];
    $validator = isset($el['#element_validate']) ? $el['#element_validate'] : [];
    $validator = array_merge([
      '_datex_date_popup_field_element_validate_callback',
    ], $validator);
    $el['#element_validate'] = $validator;
  }
}