You are here

function ctools_component_configuration_export in Configuration Management 7

Master implementation of hook_configuration_export() for all ctools components.

1 call to ctools_component_configuration_export()
context_configuration_export in includes/configuration.context.inc
Implements hook_configuration_export().

File

includes/configuration.ctools.inc, line 142

Code

function ctools_component_configuration_export($component, $data, &$export, $module_name = '') {

  // Add the actual implementing module as a dependency
  $info = _ctools_configuration_get_info();
  $new_dependencies = array();
  if ($module_name !== $info[$component]['module']) {
    $new_dependencies[$info[$component]['module']] = $info[$component]['module'];
  }

  // Add the components
  foreach ($data as $object_name) {
    if ($object = _ctools_configuration_export_crud_load($component, $object_name)) {

      // If this object is provided as a default by a different module, add
      // that module as a dependency.
      if (!empty($object->export_module) && $object->export_module !== $module_name) {
        $new_dependencies[$object->export_module] = $object->export_module;
      }
      $export['dependencies'] = array_merge($export['dependencies'], $new_dependencies);
      $export['configuration'][$component][$object_name] = $object_name;
    }
  }

  // Let CTools handle API integration for this component.
  return array(
    'ctools' => array(
      $component,
    ),
  );
}