You are here

function key_config_features_export_render in Key 7

Same name and namespace in other branches
  1. 7.3 includes/key_config.features.inc \key_config_features_export_render()
  2. 7.2 includes/key_config.features.inc \key_config_features_export_render()

Implements hook_features_export_render().

File

includes/key_config.features.inc, line 32
Provides Features integration for managing keys.

Code

function key_config_features_export_render($module_name, $data, $export = NULL) {
  $code = array();
  $code[] = '  $configs = array();';
  $code[] = '';
  foreach ($data as $name) {
    $config = key_get_config($name, TRUE);
    $config_identifier = features_var_export($name);
    $config_export = features_var_export($config, '  ');
    $code[] = "  // Exported key: {$name}.";
    $code[] = "  \$configs[{$config_identifier}] = {$config_export};";
    $code[] = "";
  }
  $code[] = '  return $configs;';
  $code = implode("\n", $code);
  return array(
    'key_default_configs' => $code,
  );
}