You are here

function custom_pub_features_export in Custom Publishing Options 7

Implements hook_features_export().

File

./custom_pub.features.inc, line 17
Adds support for the Features module.

Code

function custom_pub_features_export($data, &$export, $module_name = '') {
  $pipe = array();
  $map = features_get_default_map('custom_pub');
  $pub_types = array_keys(custom_pub_types_list());
  foreach ($data as $option) {

    // Poll node module to determine who provides the option.
    if (in_array($option, $pub_types)) {

      // If this option is provided by a different module, add it as a dependency
      if (isset($map[$option]) && $map[$option] != $module_name) {
        $export['dependencies'][$map[$option]] = $map[$option];
      }
      else {
        $export['features']['custom_pub'][$option] = $option;
        $export['dependencies']['custom_pub'] = 'custom_pub';
      }
    }
  }
  return $pipe;
}