summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.18/sites/all/modules/views/modules/field.views.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.18/sites/all/modules/views/modules/field.views.inc')
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/views/modules/field.views.inc78
1 files changed, 78 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/views/modules/field.views.inc b/kolab.org/www/drupal-7.18/sites/all/modules/views/modules/field.views.inc
index fe1968b..873153e 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/views/modules/field.views.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/views/modules/field.views.inc
@@ -396,6 +396,84 @@ function field_views_field_default_views_data($field) {
'field_name' => $field['field_name'],
);
}
+
+ // Expose additional language column for translatable fields.
+ if (!empty($field['translatable'])) {
+ $title_language = t('@label (!name:language)', array('@label' => $label, '!name' => $field['field_name']));
+ $title_short_language = t('@label:language', array('@label' => $label));
+
+ $data[$table]['language'] = array(
+ 'group' => $group,
+ 'title' => $title_language,
+ 'title short' => $title_short_language,
+ 'help' => t('Language - Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))),
+ );
+ $data[$table]['language']['field'] = array(
+ 'handler' => 'views_handler_field_locale_language',
+ );
+ $data[$table]['language']['argument'] = array(
+ 'field' => 'language',
+ 'table' => $table,
+ 'handler' => 'views_handler_argument_locale_language',
+ 'additional fields' => $additional_fields,
+ 'empty field name' => t('<No value>'),
+ 'field_name' => $field['field_name'],
+ );
+ $data[$table]['language']['filter'] = array(
+ 'field' => 'language',
+ 'table' => $table,
+ 'handler' => 'views_handler_filter_locale_language',
+ 'additional fields' => $additional_fields,
+ 'field_name' => $field['field_name'],
+ 'allow empty' => TRUE,
+ );
+ $data[$table]['language']['sort'] = array(
+ 'field' => 'language',
+ 'table' => $table,
+ 'handler' => 'views_handler_sort',
+ 'additional fields' => $additional_fields,
+ 'field_name' => $field['field_name'],
+ );
+ }
+
+ // Expose additional language column for translatable fields.
+ if (!empty($field['translatable'])) {
+ $title_language = t('@label (!name:language)', array('@label' => $label, '!name' => $field['field_name']));
+ $title_short_language = t('@label:language', array('@label' => $label));
+
+ $data[$table]['language'] = array(
+ 'group' => $group,
+ 'title' => $title_language,
+ 'title short' => $title_short_language,
+ 'help' => t('Language - Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))),
+ );
+ $data[$table]['language']['field'] = array(
+ 'handler' => 'views_handler_field_locale_language',
+ );
+ $data[$table]['language']['argument'] = array(
+ 'field' => 'language',
+ 'table' => $table,
+ 'handler' => 'views_handler_argument_locale_language',
+ 'additional fields' => $additional_fields,
+ 'empty field name' => t('<No value>'),
+ 'field_name' => $field['field_name'],
+ );
+ $data[$table]['language']['filter'] = array(
+ 'field' => 'language',
+ 'table' => $table,
+ 'handler' => 'views_handler_filter_locale_language',
+ 'additional fields' => $additional_fields,
+ 'field_name' => $field['field_name'],
+ 'allow empty' => TRUE,
+ );
+ $data[$table]['language']['sort'] = array(
+ 'field' => 'language',
+ 'table' => $table,
+ 'handler' => 'views_handler_sort',
+ 'additional fields' => $additional_fields,
+ 'field_name' => $field['field_name'],
+ );
+ }
}
}