You are here

function _datex_element_schema in Datex 7.3

Same name and namespace in other branches
  1. 8 datex.inc.php \_datex_element_schema()

Find the datex schema set for a field (or element, or views filter, or...), or the global schema of none is set.

5 calls to _datex_element_schema()
datex_date_field_formatter_settings_form_alter in ./datex_date.inc
Implements hook_date_field_formatter_settings_form_alter().
datex_date_field_widget_settings_form_alter in ./datex_date.inc
Implements hook_date_field_instance_settings_form_alter().
_datex_date_field_calendar in ./datex_date.inc
Create a datex-calendar based on field config and the schema set for it.
_datex_date_views_argument_handler_simple::_datex in ./datex.views.inc
Handle the date and convert it accordingly.
_datex_views_handler_field_date::render in ./datex.views.inc
Render the date, if it should be localized. Otherwise let parent handle it.

File

./datex.module, line 226
Datex main module file, Datex adds php-intl support to drupal.

Code

function _datex_element_schema($e) {
  $ret = NULL;
  if (is_object($e) && isset($e->options) && is_array($e->options)) {
    $ret = $e->options['datex_schema'];
  }
  elseif (is_object($e)) {
    $ret = NULL;
  }
  elseif (isset($e['datex_schema'])) {
    $ret = $e['datex_schema'];
  }
  elseif (isset($elementp['#instance']['settings']['datex_schema'])) {
    $ret = $element['#instance']['settings']['datex_schema'];
  }
  elseif (isset($e['#instance']['widget']['settings']['datex_schema'])) {
    $ret = $e['#instance']['widget']['settings']['datex_schema'];
  }
  elseif (isset($e['display']['settings']['datex_schema'])) {
    $ret = $e['display']['settings']['datex_schema'];
  }
  elseif (isset($e['view_mode']) && !empty($e['instance']['display'][$e['view_mode']]['settings']['datex_schema'])) {
    $ret = $e['instance']['display'][$e['view_mode']]['settings']['datex_schema'];
  }
  else {
    $ret = 'default';
  }
  return empty($ret) ? 'default' : $ret;
}