1 utility.inc _views_prepare_handler($definition, $data, $field, $type)

Prepare a handler's data by checking defaults and such.

File

core/modules/views/includes/utility.inc, line 70
Utility functions for assembling Views queries.

Code

function _views_prepare_handler($definition, $data, $field, $type) {
  foreach (array('group', 'title', 'title short', 'help', 'real field') as $key) {
    if (!isset($definition[$key])) {
      // First check the field level
      if (!empty($data[$field][$key])) {
        $definition[$key] = $data[$field][$key];
      }
      // Then if that doesn't work, check the table level
      elseif (!empty($data['table'][$key])) {
        $definition[$key] = $data['table'][$key];
      }
    }
  }

  return _views_create_handler($definition, 'handler', $type);
}