You are here

function i18nviews_views_data_alter in Internationalization Views 6.3

Same name and namespace in other branches
  1. 6.2 includes/i18nviews.views.inc \i18nviews_views_data_alter()
  2. 7.3 includes/i18nviews.views.inc \i18nviews_views_data_alter()

Implemenation of hook_views_data_alter().

File

includes/i18nviews.views.inc, line 65

Code

function i18nviews_views_data_alter(&$data) {

  // Replace term_data handlers.
  $data['term_data']['name']['field']['handler'] = 'i18nviews_handler_field_taxonomy';
  $data['term_data']['description']['field']['handler'] = 'i18nviews_handler_field_term_description';
  $data['term_node']['tid']['field']['handler'] = 'i18nviews_handler_field_term_node_tid';
  $data['term_node']['tid']['argument']['handler'] = 'i18nviews_handler_argument_term_node_tid';
  $data['term_node']['tid']['filter']['handler'] = 'i18nviews_handler_filter_term_node_tid';
  $data['node']['term_node_tid_depth']['argument']['handler'] = 'i18nviews_handler_argument_term_node_tid_depth';

  // Add i18n language field to term_data.
  $data['term_data']['language'] = array(
    'group' => t('Term translation'),
    'title' => t('Language'),
    'help' => t('The language the term is in.'),
    'field' => array(
      'handler' => 'i18nviews_handler_field_term_language',
      'click sortable' => TRUE,
    ),
    'filter' => array(
      'handler' => 'i18nviews_handler_filter_term_language',
    ),
    'argument' => array(
      'handler' => 'i18nviews_handler_argument_term_language',
    ),
  );
}