You are here

function _views_prepare_handler in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 6.2 includes/handlers.inc \_views_prepare_handler()
  2. 7.3 includes/handlers.inc \_views_prepare_handler()

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

1 call to _views_prepare_handler()
views_get_handler in ./views.module
Fetch a handler from the data cache.

File

includes/handlers.inc, line 108
handlers.inc Defines the various handler objects to help build and display views.

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];
      }
      else {
        if (!empty($data['table'][$key])) {
          $definition[$key] = $data['table'][$key];
        }
      }
    }
  }
  return _views_create_handler($definition, 'handler', $type);
}