You are here

function uc_product_classes_features_export in Ubercart 6.2

Same name and namespace in other branches
  1. 7.3 uc_product/uc_product.features.inc \uc_product_classes_features_export()

Implements hook_features_export().

File

uc_product/uc_product.features.inc, line 22
Features integration for Ubercart product classes.

Code

function uc_product_classes_features_export($data, &$export, $module_name = '') {
  $export['dependencies']['uc_product'] = 'uc_product';
  foreach ($data as $class) {
    $export['features']['uc_product_classes'][$class] = $class;
  }

  // Create a pipe for the CCK fields and variables to be exported.
  // This used to just return $pipe = array('node' => $data); but this
  // stopped working in Features 6.x-1.2. See http://drupal.org/node/1404486
  $pipe = node_features_export($data, $export, $module_name);

  // If strongarm is available, export the shippable and image settings.
  if (module_exists('strongarm')) {
    foreach ($data as $class) {
      $pipe['variable'][] = "uc_product_shippable_{$class}";
      $pipe['variable'][] = "uc_image_{$class}";
    }
  }
  return $pipe;
}