You are here

function variable_realm_features_export_render in Variable 7

Same name and namespace in other branches
  1. 7.2 variable_realm/variable_realm.features.inc \variable_realm_features_export_render()

Implements hook_features_export_render().

File

variable_realm/variable_realm.features.inc, line 68
Features support for Variable store.

Code

function variable_realm_features_export_render($module_name, $data, $export = NULL) {
  variable_realm_features_load($module_name, 'variable_realm_default_variables', FALSE);
  $code = array();
  $code[] = '$realm_variables = array();';
  foreach ($data as $machine_name) {
    list($realm, $key) = explode(':', $machine_name);
    $variable_realm = variable_realm_controller_build($realm, $key);
    $variables = $variable_realm
      ->variable_list();
    $code[] = "  \$realm_variables['{$realm}']['{$key}'] = " . features_var_export($variables) . ";";
  }
  $code[] = "\nreturn \$realm_variables;";
  $output = implode("\n", $code);
  return array(
    'variable_realm_default_variables' => $output,
  );
}