summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Reyero2011-09-17 16:02:27 (GMT)
committer Jose Reyero2011-09-17 16:02:27 (GMT)
commit0a00d5cc895a16af9c5188807733358fba2ba546 (patch)
tree9d7da463bd0d31ad1938ea972660789480ff4510
parentb949cc2bd995120e4b6161e3e1c8b4dfe8fda124 (diff)
Issue #1182058 by das-peter: Added entity_translation() support. First chunk: added i18n_entity_translation_enabled()
-rw-r--r--i18n.module14
1 files changed, 14 insertions, 0 deletions
diff --git a/i18n.module b/i18n.module
index 3ad8583..0d3ab9d 100644
--- a/i18n.module
+++ b/i18n.module
@@ -448,3 +448,17 @@ function i18n_prepare_normal_path($link_path, $language) {
}
return $normal_path;
}
+
+/**
+ * Checks if an entity translation is enabled for the given entity type.
+ * @param $entity_type
+ */
+function i18n_entity_translation_enabled($entity_type) {
+ $cache = &drupal_static(__FUNCTION__);
+ if (!isset($cache[$entity_type])) {
+ // Check if the entity_translation module exists and if so if the given
+ // entity type is handled.
+ $cache[$entity_type] = module_exists('entity_translation') && entity_translation_enabled($entity_type);
+ }
+ return $cache[$entity_type];
+} \ No newline at end of file