You are here

function profile_field_features_export_render in Features 6

Implementation of hook_features_export_render().

File

includes/features.profile.inc, line 46

Code

function profile_field_features_export_render($module, $data) {
  $code = array();
  $code[] = '$profile_fields = array();';
  foreach ($data as $name) {
    $db_result = db_query("SELECT * FROM {profile_fields} WHERE name = '%s'", $name);
    if ($field = db_fetch_array($db_result)) {
      unset($field['fid']);
      $code[] = "\$profile_fields['{$name}'] = " . features_var_export($field) . ";";
    }
  }
  $code[] = "return \$profile_fields;";
  $code = implode("\n", $code);
  return array(
    'profile_default_profile_fields' => $code,
  );
}