summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Wehner2012-10-06 23:38:11 (GMT)
committerTim Plunkett2012-10-22 02:49:02 (GMT)
commitda4fcc95201daea0d84cc73027220a0a54719023 (patch)
treedae0f6bc7e02fc49bbdbddf4f67992a256c457fd
parent09183ab633e05c2fef41e0a6480c88b9cb287aa5 (diff)
Issue #1515156 by plach, fabsor, steinmb, dawehner: Added Expose the field language column for translatable fields.
-rw-r--r--modules/field.views.inc39
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/field.views.inc b/modules/field.views.inc
index d97806a..5e1e849 100644
--- a/modules/field.views.inc
+++ b/modules/field.views.inc
@@ -394,6 +394,45 @@ 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(
+ 'id' => 'language',
+ );
+ $data[$table]['language']['argument'] = array(
+ 'field' => 'language',
+ 'table' => $table,
+ 'id' => '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,
+ 'id' => 'language',
+ 'additional fields' => $additional_fields,
+ 'field_name' => $field['field_name'],
+ 'allow empty' => TRUE,
+ );
+ $data[$table]['language']['sort'] = array(
+ 'field' => 'language',
+ 'table' => $table,
+ 'id' => 'standard',
+ 'additional fields' => $additional_fields,
+ 'field_name' => $field['field_name'],
+ );
+ }
}
}