You are here

function _datex_popup_get_element_info in Datex 7.2

Helper function to extract schema and granularitis.

2 calls to _datex_popup_get_element_info()
datex_popup_date_popup_process_alter in datex_popup/datex_popup.module
Implements hook_date_popup_process_alter().
_datex_popup_element_validate_callback in datex_popup/datex_popup.module
Form element validation callback.

File

datex_popup/datex_popup.module, line 34

Code

function _datex_popup_get_element_info(array $element) {
  if (isset($element['#instance']['widget']['settings']['datex_schema'])) {
    $field_schema = $element['#instance']['widget']['settings']['datex_schema'];
  }
  else {
    $field_schema = 'default';
  }
  if (isset($element['#granularity'])) {
    $g = $element['#granularity'];
  }
  elseif (isset($element['#field']['settings']['granularity'])) {
    $g = $element['#field']['settings']['granularity'];
  }
  else {
    $g = array(
      'year',
      'month',
      'day',
      'minute',
      'hour',
      'second',
    );
  }
  return array(
    $field_schema,
    $g,
  );
}