From e6af311a17a4d7a3b5e20fa123c2794ac9b5f256 Mon Sep 17 00:00:00 2001
From: flow <f.weber@digi-info.de>
Date: Wed, 11 May 2011 17:38:37 +0200
Subject: [PATCH] implement hook_features_pipe_node_alter for i18n_node and i18n_sync variables. use meta information from variables module.

---
 i18n_node/i18n_node.features.inc |   26 ++++++++++++++++++++++++++
 i18n_sync/i18n_sync.features.inc |   26 ++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 0 deletions(-)
 create mode 100644 i18n_node/i18n_node.features.inc
 create mode 100644 i18n_sync/i18n_sync.features.inc

diff --git a/i18n_node/i18n_node.features.inc b/i18n_node/i18n_node.features.inc
new file mode 100644
index 0000000..0f77aaa
--- /dev/null
+++ b/i18n_node/i18n_node.features.inc
@@ -0,0 +1,26 @@
+<?php
+/**
+ * @file
+ * Feature integration
+ */
+
+/**
+ * Implements hook_features_pipe_node_alter()
+ */
+function i18n_node_features_pipe_node_alter(&$pipe, $data, $export) {
+  if (!empty($data) && module_exists('variable')) {
+    variable_include();
+    foreach(variable_list_module('i18n_node') as $variable) {
+      if (isset($variable['multiple']) && $variable['multiple'] === 'node_type') {
+        $children = variable_build($variable['name']);
+        if (!empty($children['children'])) {
+          foreach ($children['children'] as $child_variable) {
+            if (in_array($child_variable['index'], $data)) {
+              $pipe['variable'][] = $child_variable['name'];
+            }
+          }
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/i18n_sync/i18n_sync.features.inc b/i18n_sync/i18n_sync.features.inc
new file mode 100644
index 0000000..c708398
--- /dev/null
+++ b/i18n_sync/i18n_sync.features.inc
@@ -0,0 +1,26 @@
+<?php
+/**
+ * @file
+ * Feature integration
+ */
+
+/**
+ * Implements hook_features_pipe_node_alter()
+ */
+function i18n_sync_features_pipe_node_alter(&$pipe, $data, $export) {
+  if (!empty($data) && module_exists('variable')) {
+    variable_include();
+    foreach(variable_list_module('i18n_sync') as $variable) {
+      if (isset($variable['multiple']) && $variable['multiple'] === 'node_type') {
+        $children = variable_build($variable['name']);
+        if (!empty($children['children'])) {
+          foreach ($children['children'] as $child_variable) {
+            if (in_array($child_variable['index'], $data)) {
+              $pipe['variable'][] = $child_variable['name'];
+            }
+          }
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
-- 
1.7.3.4

