You are here

public function ShowEmailAddress::settingsSummary in Show Email Address 8

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/ShowEmailAddress.php, line 37

Class

ShowEmailAddress
Plugin implementation of the 'show_email_address' formatter.

Namespace

Drupal\show_email\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $user_one = $this
    ->getSetting('hide_user_one');
  if (!empty($user_one)) {
    $summary[] = $this
      ->t('User one is hidden.');
  }
  else {
    $summary[] = $this
      ->t('User one is NOT hidden.');
  }
  $email_mailto = $this
    ->getSetting('email_mailto');
  if (!empty($email_mailto)) {
    $summary[] = $this
      ->t('Mailto is enabled.');
  }
  else {
    $summary[] = $this
      ->t('Mailto is NOT enabled.');
  }
  return $summary;
}