You are here

function location_cck_field_settings in Location 7.5

Same name and namespace in other branches
  1. 5.3 contrib/location_cck/location_cck.module \location_cck_field_settings()
  2. 6.3 contrib/location_cck/location_cck.module \location_cck_field_settings()
  3. 7.3 contrib/location_cck/location_cck.module \location_cck_field_settings()
  4. 7.4 contrib/location_cck/location_cck.module \location_cck_field_settings()

Implements hook_field_settings().

File

contrib/location_cck/location_cck.module, line 110
Defines location field type.

Code

function location_cck_field_settings($op, $field) {
  switch ($op) {
    case 'views data':

      // We want to for the most part use the CCK stuff, but we also want to
      // patch in a relationship so location's views support can target
      // cck fields directly.
      $table = content_views_tablename($field);
      $db_info = content_database_info($field);
      $field_alias = $db_info['columns']['lid']['column'];
      $data = content_views_field_views_data($field);
      $data[$table][$field_alias]['relationship'] = array(
        'base' => 'location',
        'field' => 'lid',
        'handler' => 'views_handler_relationship',
        'label' => t('Location'),
      );
      return $data;
  }
}