function flag_features_export in Flag 6.2
Same name and namespace in other branches
- 7.3 includes/flag.features.inc \flag_features_export()
 - 7.2 includes/flag.features.inc \flag_features_export()
 
Implements hook_features_export().
File
- includes/
flag.features.inc, line 11  - Features integration for Flag module.
 
Code
function flag_features_export($data, &$export, $module_name = '') {
  $pipe = array();
  // Add flag module as a dependency.
  $export['dependencies']['features'] = 'flag';
  // Ensure the modules that provide the flag are included as dependencies.
  $modules = flag_features_providing_module();
  foreach ($data as $key => $flag) {
    // Get the module that provided the flag definition.
    if ($flag = flag_load($flag, TRUE)) {
      $module = $modules[$flag->content_type];
      $export['dependencies'][$module] = $module;
      $export['features']['flag'][$flag->name] = $flag->name;
    }
  }
  return $pipe;
}