You are here

function datex_element_info_alter in Datex 7.2

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

Adds datex as a date form element validator.

So we get a chance to convert Jalali to Greg.

File

./datex_date.inc, line 224
Provides Jalali support for date module.

Code

function datex_element_info_alter(&$elements) {
  foreach (array(
    'select',
    'popup',
  ) as $name) {
    $name = 'date_' . $name;
    if (isset($elements[$name])) {
      if (isset($elements[$name]['#element_validate'])) {
        $validator = $elements[$name]['#element_validate'];
      }
      else {
        $validator = array();
      }
      $validator = array_merge(array(
        '_datex_element_validate_callback',
      ), $validator);
      $elements[$name]['#element_validate'] = $validator;
    }
  }
}