You are here

function i18n_views_tables in Internationalization 5

Views integration

File

i18nviews/i18nviews.module, line 15
Views support for Internationalization (i18n) package

Code

function i18n_views_tables() {
  $tables['i18n'] = array(
    'name' => 'i18n_node',
    'join' => array(
      'left' => array(
        'table' => 'node',
        'field' => 'nid',
      ),
      'right' => array(
        'field' => 'nid',
      ),
    ),
  );
  $tables['i18n']['fields']['language'] = array(
    'name' => t('Internationalization: Language'),
    'sortable' => true,
    'handler' => 'i18n_views_handler_language',
  );
  $tables['i18n']['filters']['language'] = array(
    'name' => t('Internationalization: Language'),
    'list-type' => 'list',
    'value-type' => 'array',
    'list' => 'i18n_views_language_list',
    'operator' => 'views_handler_operator_or',
    'help' => t('Enabled languages for content.'),
  );
  $tables['i18n']['filters']['extlanguage'] = array(
    'field' => 'language',
    'name' => t('Internationalization: Language (extended)'),
    'list-type' => 'list',
    'value-type' => 'array',
    'list' => 'i18n_views_language_list_all',
    'operator' => 'views_handler_operator_or',
    'help' => t('All defined languages for content.'),
  );
  $tables['i18n']['filters']['selection'] = array(
    'name' => t('Internationalization: Selection'),
    'handler' => 'i18n_views_filter_handler',
    'list-type' => 'select',
    'operator' => array(
      '=' => t('Is'),
    ),
    'list' => '_i18n_selection_mode',
    'help' => t('Content language.'),
    'cacheable' => 'no',
  );
  return $tables;
}