You are here

function rules_categories_features_export in Rules 6

Implementation of hook_features_export() for categories.

File

rules/rules.export.inc, line 95
Provides export functionality and integrates with the features module.

Code

function rules_categories_features_export($data, &$export, $module_name = '') {
  rules_include('rules_admin');
  module_load_include('inc', 'rules_admin', 'rules_admin.export');
  $rules_export = array();
  rules_admin_export_by_category($rules_export, $data);

  // Process the rules and sets to be exported for dependencies.
  $pipe = array();
  $rules_export += array(
    'rules' => array(),
    'rule_sets' => array(),
  );
  foreach ($rules_export['rules'] as $rule) {
    rules_features_process_rule($rule, $export, $pipe);
  }
  foreach ($rules_export['rule_sets'] as $set_name => $set) {
    rules_features_process_set($set_name, $export, $pipe);
  }
  $export['features']['rules_categories'] = drupal_map_assoc($data);
  $export['dependencies']['rules'] = 'rules';
  return $pipe;
}