You are here

function field_group_format_settings_summary in Field Group 8

Same name and namespace in other branches
  1. 8.3 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 500
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(array(
    'format_type' => $group->format_type,
    'configuration' => array(
      'label' => $group->label,
      'settings' => $group->format_settings,
    ),
    'group' => $group,
  ));
  $summary = $plugin
    ->settingsSummary();
  return array(
    '#markup' => '<div class="field-plugin-summary">' . implode('<br />', $summary) . '</div>',
    '#cell_attributes' => array(
      'class' => array(
        'field-plugin-summary-cell',
      ),
    ),
  );
}