From c27ed43c4fc86ba716d22853721ebe89fbebfc21 Mon Sep 17 00:00:00 2001
From: Andrew Berry <deviantintegral@gmail.com>
Date: Fri, 30 Sep 2011 13:24:09 -0400
Subject: [PATCH] Issue #1296078: Add Features support to export content type
 variables.

---
 private.module |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/private.module b/private.module
index 25336f5..82f638a 100644
--- a/private.module
+++ b/private.module
@@ -326,4 +326,28 @@ function private_views_api() {
     'api' => 2,
     'path' => drupal_get_path('module', 'private'),
   );
-}
\ No newline at end of file
+}
+
+/**
+ * Implementation of hook_features_pipe_COMPONENT_alter().
+ */
+function private_features_pipe_node_alter(&$pipe, $data, $export) {
+  if (!empty($data)) {
+    $map = features_get_default_map('variable');
+    $variables = array(
+      'private',
+    );
+    foreach ($data as $node_type) {
+      foreach ($variables as $variable_name) {
+        $variable_name = "{$variable_name}_{$node_type}";
+        if (isset($map[$variable_name]) && $map[$variable_name] != $module_name) {
+          $export['dependencies'][$map[$variable_name]] = $map[$variable_name];
+        }
+        else {
+          $pipe['variable'][] = $variable_name;
+        }
+      }
+    }
+  }
+}
+
-- 
1.7.6.4

