You are here

function conditional_fields_features_export_render in Conditional Fields 6.2

Same name and namespace in other branches
  1. 7.3 includes/conditional_fields.features.inc \conditional_fields_features_export_render()

Implmentation of hook_features_export_render()

File

includes/conditional_fields.features.inc, line 30

Code

function conditional_fields_features_export_render($module_name = '', $data) {
  $code[] = '$items = array();';
  foreach ($data as $type) {
    $query = db_query("SELECT * FROM {conditional_fields} WHERE type='%s'", $type);
    while ($result = db_fetch_array($query)) {
      $row = $result;
      $row['trigger_values'] = unserialize($row['trigger_values']);
      $code[] = '$items[] = ' . var_export($row, TRUE) . ';';
    }
  }
  $code[] = 'return $items;';
  $code = implode("\n", $code);
  return array(
    'conditional_fields_default_fields' => $code,
  );
}