You are here

function key_config_features_export_render in Key 7.3

Same name and namespace in other branches
  1. 7 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 $id) {
    $config = key_get_key($id, TRUE);
    $config_identifier = features_var_export($id);
    $config_export = features_var_export($config, '  ');
    $code[] = "  // Exported key: {$id}.";
    $code[] = "  \$configs[{$config_identifier}] = {$config_export};";
    $code[] = "";
  }
  $code[] = '  return $configs;';
  $code = implode("\n", $code);
  return array(
    'key_default_configs' => $code,
  );
}