You are here

function field_group_disabled_groups_overview in Field Group 7

Show an overview of all the disabled fieldgroups, and make it possible to activate them again.

Parameters

$disabled_groups Array with all disabled groups.:

1 call to field_group_disabled_groups_overview()
field_group_field_ui_create_vertical_tabs in ./field_group.field_ui.inc
Create vertical tabs.

File

./field_group.field_ui.inc, line 973
Field_group.field_ui.inc is a file that contains most functions needed on the Fields UI Manage forms (display and fields).

Code

function field_group_disabled_groups_overview($disabled_groups, $entity_info, $params) {
  $formatter_options = field_group_field_formatter_options($params->mode != 'form' ? 'display' : 'form');
  $table = array(
    '#theme' => 'table',
    '#header' => array(
      t('Label'),
      t('Machine name'),
      t('Field'),
      t('Widget'),
      t('Operations'),
    ),
    '#attributes' => array(
      'class' => array(
        'field-ui-overview',
      ),
    ),
    '#rows' => array(),
  );

  // Add all of the disabled groups as a row on the table.
  foreach ($disabled_groups as $group) {
    $summary = field_group_format_settings_summary($group->group_name, $group);
    $row = array();
    $row[] = $group->label;
    $row[] = $group->group_name;
    $row[] = $formatter_options[$group->format_type];
    $row[] = render($summary);
    $path = isset($entity_info['bundles'][$params->bundle]['admin']['real path']) ? $entity_info['bundles'][$params->bundle]['admin']['real path'] : $entity_info['bundles'][$params->bundle]['admin']['path'];
    $row[] = l(t('Enable'), $path . '/groups/' . $group->group_name . '/enable/' . $group->mode);
    $table['#rows'][] = $row;
  }
  return $table;
}