You are here

function _datex_get_fs in Datex 7.3

Extract date value from form state.

4 calls to _datex_get_fs()
datex_date_select_process_alter in ./datex_date.inc
Implements hook_date_select_process_alter().
datex_popup_date_popup_process_alter in datex_popup/datex_popup.module
Implements hook_date_popup_process_alter().
_datex_date_popup_field_element_validate_callback in datex_popup/datex_popup.module
Form element validation callback for date popup form element.
_datex_select_date_field_element_validate_callback in ./datex_date.inc
To convert the day back to Gregorian.

File

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

Code

function _datex_get_fs(&$element, &$fs, $extra_parent = NULL, $is_input = TRUE) {
  $key = $is_input ? 'input' : 'value';
  if (!isset($fs[$key]) || !is_array($fs[$key])) {
    if (!$is_input) {
      $key = 'values';
      if (!isset($fs[$key]) || !is_array($fs[$key])) {
        return NULL;
      }
    }
    else {
      return NULL;
    }
  }
  $dummy = NULL;
  $parents = $element['#parents'];
  $nested = drupal_array_get_nested_value($fs[$key], $parents, $dummy);
  if (is_string($nested)) {
    return NULL;
  }
  elseif ($extra_parent) {
    return isset($nested[$extra_parent]) ? trim($nested[$extra_parent]) : NULL;
  }
  else {
    return $nested;
  }
}