You are here

public function WebformEntityReferenceLinkFormatter::settingsSummary in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/Field/FieldFormatter/WebformEntityReferenceLinkFormatter.php \Drupal\webform\Plugin\Field\FieldFormatter\WebformEntityReferenceLinkFormatter::settingsSummary()

Returns a short summary for the current formatter settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the formatter has configurable settings.

Return value

string[] A short summary of the formatter settings.

Overrides FormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/WebformEntityReferenceLinkFormatter.php, line 72

Class

WebformEntityReferenceLinkFormatter
Plugin implementation of the 'Link to webform' formatter.

Namespace

Drupal\webform\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $summary[] = $this
    ->t('Label: @label', [
    '@label' => $this
      ->getSetting('label'),
  ]);
  $dialog_option_name = $this
    ->getSetting('dialog');
  if ($dialog_option = $this->configFactory
    ->get('webform.settings')
    ->get('settings.dialog_options.' . $dialog_option_name)) {
    $summary[] = $this
      ->t('Dialog: @dialog', [
      '@dialog' => isset($dialog_option['title']) ? $dialog_option['title'] : $dialog_option_name,
    ]);
  }
  return $summary;
}