You are here

function farm_equipment_field_field_group_info in farmOS 7

Implements hook_field_group_info().

File

modules/farm/farm_equipment/farm_equipment_field/farm_equipment_field.module, line 121

Code

function farm_equipment_field_field_group_info() {
  $field_groups = array();

  // Get a list of log types.
  $log_types = log_types();

  // Iterate through the log types and add an equipment field group to each.
  foreach ($log_types as $bundle => $info) {
    $group_name = 'group_farm_equipment';
    $entity_type = 'log';
    $field_group = new stdClass();
    $field_group->disabled = FALSE;

    /* Edit this to true to make a default field_group disabled initially */
    $field_group->api_version = 1;
    $field_group->identifier = $group_name . '|' . $entity_type . '|' . $bundle . '|form';
    $field_group->group_name = $group_name;
    $field_group->entity_type = $entity_type;
    $field_group->bundle = $bundle;
    $field_group->mode = 'form';
    $field_group->parent_name = 'group_farm_tabs';
    $field_group->data = array(
      'label' => t('Equipment'),
      'weight' => '3',
      'children' => array(
        0 => 'field_farm_equipment',
      ),
      'format_type' => 'fieldset',
      'format_settings' => array(
        'label' => t('Equipment'),
        'instance_settings' => array(
          'required_fields' => 1,
          'id' => '',
          'classes' => 'group-farm-assets field-group-fieldset',
          'description' => '',
        ),
        'formatter' => 'open',
      ),
    );
    $field_groups[$group_name . '|' . $entity_type . '|' . $bundle . '|form'] = $field_group;
  }
  return $field_groups;
}