You are here

function field_group_format_settings_summary in Field Group 8.3

Same name and namespace in other branches
  1. 8 includes/field_ui.inc \field_group_format_settings_summary()
  2. 7.2 field_group.field_ui.inc \field_group_format_settings_summary()
  3. 7 field_group.field_ui.inc \field_group_format_settings_summary()

Creates a summary for the field format configuration summary.

Parameters

string $group_name: The name of the group.

Object $group: The group object.

Return value

Array ready to be rendered.

1 call to field_group_format_settings_summary()
field_group_field_ui_display_form_alter in includes/field_ui.inc
Function to alter the display overview screens.

File

includes/field_ui.inc, line 573
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_format_settings_summary($group_name, $group) {
  $manager = \Drupal::service('plugin.manager.field_group.formatters');
  $plugin = $manager
    ->getInstance([
    'format_type' => $group->format_type,
    'configuration' => [
      'label' => $group->label,
      'settings' => $group->format_settings,
    ],
    'group' => $group,
  ]);
  if ($plugin) {
    $summary = $plugin
      ->settingsSummary();
  }
  else {
    $summary = '';
  }
  return [
    '#markup' => '<div class="field-plugin-summary">' . implode('<br />', $summary) . '</div>',
    '#cell_attributes' => [
      'class' => [
        'field-plugin-summary-cell',
      ],
    ],
  ];
}