You are here

function entity_translation_views_data in Entity Translation 7

Implements hook_views_data().

File

views/entity_translation.views.inc, line 11
Provide views data and handlers for entity_translation.

Code

function entity_translation_views_data() {
  $data = array();
  $data['entity_translation']['table']['group'] = t('Entity translation');

  // Advertise this table as a possible base table.
  $data['entity_translation']['table']['base'] = array(
    'field' => 'entity_id',
    'title' => t('Entity translation'),
    'help' => t('Information about a translation of an entity.'),
  );
  $data['entity_translation']['entity_id'] = array(
    'title' => t('Entity id'),
    'help' => t('The entity id.'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
      'numeric' => TRUE,
      'validate type' => 'entity_id',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['entity_translation']['entity_type'] = array(
    'title' => t('Entity type'),
    'help' => t('The entity type.'),
    'field' => array(
      'handler' => 'views_handler_field',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_string',
      'numeric' => FALSE,
      'validate type' => 'entity_type',
    ),
    'filter' => array(
      'handler' => 'entity_translation_handler_filter_entity_type',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['entity_translation']['language'] = array(
    'title' => t('Language'),
    'help' => t('The language of this translation.'),
    'field' => array(
      'handler' => 'views_handler_field_locale_language',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_locale_language',
      'numeric' => FALSE,
      'validate type' => 'language',
    ),
    'filter' => array(
      'handler' => 'entity_translation_handler_filter_language',
      'allow empty' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['entity_translation']['source'] = array(
    'title' => t('Source'),
    'help' => t('The source language.'),
    'field' => array(
      'handler' => 'views_handler_field_locale_language',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_locale_language',
      'name field' => 'title',
      'numeric' => FALSE,
      'validate type' => 'string',
    ),
    'filter' => array(
      'handler' => 'entity_translation_handler_filter_language',
      'allow empty' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['entity_translation']['status'] = array(
    'title' => t('Translation status'),
    'help' => t('The status of this translation.'),
    'field' => array(
      'handler' => 'views_handler_field_boolean',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
      'numeric' => TRUE,
      'validate type' => 'boolean',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_boolean_operator',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['entity_translation']['translate'] = array(
    'title' => t('Needs update'),
    'help' => t('Indicates if the translation needs to be updated.'),
    'field' => array(
      'handler' => 'views_handler_field_boolean',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_numeric',
      'name field' => 'title',
      'numeric' => TRUE,
      'validate type' => 'boolean',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_boolean_operator',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['entity_translation']['created'] = array(
    'title' => t('Created'),
    'help' => t('Created date.'),
    'field' => array(
      'handler' => 'views_handler_field_date',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_date',
      'numeric' => FALSE,
      'validate type' => 'date',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_date',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort_date',
    ),
  );
  $data['entity_translation']['changed'] = array(
    'title' => t('Changed'),
    'help' => t('Changed date.'),
    'field' => array(
      'handler' => 'views_handler_field_date',
      'click sortable' => TRUE,
    ),
    'argument' => array(
      'handler' => 'views_handler_argument_date',
      'numeric' => FALSE,
      'validate type' => 'date',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_date',
    ),
    'sort' => array(
      'handler' => 'views_handler_sort_date',
    ),
  );
  $data['entity_translation']['translate_link'] = array(
    'title' => t('Translate link'),
    'help' => t('Link to translation overview page.'),
    'field' => array(
      'handler' => 'entity_translation_handler_field_translate_link',
    ),
  );
  $data['entity_translation']['translation_exists'] = array(
    'title' => t('Translation exists'),
    'help' => t('Determines if a translation exists for a particular translation.'),
    'filter' => array(
      'handler' => 'entity_translation_handler_filter_translation_exists',
    ),
  );
  $data['entity_translation']['label'] = array(
    'title' => t('Label'),
    'help' => t('The label of the entity.'),
    'field' => array(
      'handler' => 'entity_translation_handler_field_label',
    ),
  );
  return $data;
}