You are here

function entity_background_get_field_group_data in Entity background 7

Generates a data array which is used for the field group.

Parameters

array $label: An array of fields that should be assigned to the group.

int $weight: A weight of the group.

Return value

array A data array of the group.

1 call to entity_background_get_field_group_data()
entity_background_create_bd_field_group in ./entity_background.module
Helper function used to create a field group on the bd field collection.

File

./entity_background.module, line 361
Module file entity background.

Code

function entity_background_get_field_group_data($label, $fields, $weight = 0) {
  $data = array(
    'label' => $label,
    'weight' => $weight,
    'format_type' => 'html-element',
    'format_settings' => array(
      'instance_settings' => array(
        'element' => 'div',
        'show_label' => 0,
        'label_element' => 'div',
        'classes' => '',
        'attributes' => '',
        'required_fields' => 1,
      ),
    ),
  );

  // Defines fields.
  foreach ($fields as $field) {
    $data['children'][] = $field;
  }
  return $data;
}