Commit 97fb3d4b authored by dawehner's avatar dawehner Committed by tim.plunkett
Browse files

Add basic language.module views integration.

parent 0e36074e
<?php
/**
* @file
* Provide views data and handlers for language.module.
*
* @ingroup views_module_handlers
*/
/**
* Implements hook_views_data().
*/
function language_views_data() {
$data['language']['table']['group'] = t('Language');
$data['language']['table']['base'] = array(
'field' => 'langcode',
'title' => t('Language'),
'help' => t('A language used in drupal.'),
);
// name
// direction
// weight
$data['language']['langcode'] = array(
'title' => t('Language code'),
'help' => t("Language code, e.g. 'de' or 'en-US'."),
'field' => array(
'handler' => 'views_handler_field',
),
'filter' => array(
'handler' => 'views_handler_filter_string'
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
$data['language']['name'] = array(
'title' => t('Language name'),
'help' => t("Language name, e.g. 'German' or 'English'."),
'field' => array(
'handler' => 'views_handler_field',
),
'filter' => array(
'handler' => 'views_handler_filter_string'
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
$data['language']['direction'] = array(
'title' => t('Direction'),
'help' => t('Direction of language (Left-to-Right = 0, Right-to-Left = 1).'),
'field' => array(
'handler' => 'views_handler_field_numeric',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric'
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
$data['language']['weight'] = array(
'title' => t('Weight'),
'help' => t('Weight, used in lists of languages.'),
'field' => array(
'handler' => 'views_handler_field_numeric',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric'
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
return $data;
}
......@@ -2397,6 +2397,10 @@ function filter_views_api() { return views_views_api(); }
function image_views_api() { return views_views_api(); }
}
if (!function_exists('language_views_api')) {
function language_views_api() { return views_views_api(); }
}
if (!function_exists('locale_views_api')) {
function locale_views_api() { return views_views_api(); }
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment