You are here

function foundation_group_field_group_format_settings in ZURB Section 7.3

Same name and namespace in other branches
  1. 8.5 foundation_group.module \foundation_group_field_group_format_settings()
  2. 7.2 foundation_group.module \foundation_group_field_group_format_settings()

Implements hook_field_group_format_settings().

File

./foundation_group.module, line 57

Code

function foundation_group_field_group_format_settings($group) {

  // Add a wrapper for extra settings to use by others.
  $form = array(
    'instance_settings' => array(
      '#tree' => TRUE,
      '#weight' => 2,
    ),
  );
  $field_group_types = field_group_formatter_info();
  $mode = $group->mode == 'form' ? 'form' : 'display';
  $formatter = $field_group_types[$mode][$group->format_type];
  if ($group->format_type === 'foundation_group_accordion') {
    $form['instance_settings']['group_type'] = array(
      '#title' => t('Grouping type'),
      '#type' => 'select',
      '#options' => drupal_map_assoc(array(
        'auto',
        'accordion',
      )),
      '#default_value' => isset($group->format_settings['instance_settings']['group_type']) ? $group->format_settings['instance_settings']['group_type'] : $formatter['instance_settings']['group_type'],
    );
  }
  return $form;
}