You are here

function ctools_component_configuration_export_render in Configuration Management 7

Master implementation of hook_configuration_export_render() for all ctools components.

3 calls to ctools_component_configuration_export_render()
ctools_configuration_check in includes/configuration.ctools.inc
ctools_configuration_hash in includes/configuration.ctools.inc
page_manager_pages_configuration_export_render in includes/configuration.ctools.inc
Implements hook_configuration_export_render() for page_manager.

File

includes/configuration.ctools.inc, line 170

Code

function ctools_component_configuration_export_render($component, $module, $data) {
  ctools_include('export');
  $schema = ctools_export_get_schema($component);
  if (function_exists($schema['export']['to hook code callback'])) {
    $export = $schema['export']['to hook code callback']($data, $module);
    $code = explode("{\n", $export);
    array_shift($code);
    $code = explode('}', implode($code, "{\n"));
    array_pop($code);
    $code = implode('}', $code);
  }
  else {
    $code = '  $export = array();' . "\n\n";
    foreach ($data as $object_name) {
      if ($object = _ctools_configuration_export_crud_load($component, $object_name)) {
        $identifier = $schema['export']['identifier'];
        $code .= _ctools_configuration_export_crud_export($component, $object, '  ');
        $code .= "  \$export[" . ctools_var_export($object_name) . "] = \${$identifier};\n\n";
      }
    }
    $code .= '  return $export;';
  }
  return array(
    'configuration_' . $schema['export']['default hook'] => $code,
  );
}