You are here

function field_patterns_export_all_fields in Patterns 7.2

Same name and namespace in other branches
  1. 7 patterns_components/components/field.inc \field_patterns_export_all_fields()
1 string reference to 'field_patterns_export_all_fields'
field_patterns in patterns_components/components/field.inc
@file Patterns component for Fields.

File

patterns_components/components/field.inc, line 85
Patterns component for Fields.

Code

function field_patterns_export_all_fields($args = NULL, &$result = NULL) {

  //  $info = field_patterns(NULL);
  _field_info_collate_fields(true);
  _field_info_collate_types(true);

  //  $form_id = current($info['field'][PATTERNS_MODIFY]);
  $instances = field_read_instances();
  $result = array();
  foreach ($instances as $voc) {
    $voc = (array) $voc;
    $data = array(
      'tag' => 'field',
    );
    $field = field_info_field($voc['field_name']);
    $data['field_name'] = $voc['field_name'];
    $data['entity_type'] = $voc['entity_type'];
    $data['bundle'] = $voc['bundle'];
    $data['settings'] = $field['settings'];

    //  $data = array_merge($data, $voc);
    $action = array(
      PATTERNS_MODIFY => $data,
    );
    array_push($result, $action);
  }
  return $result;
}