You are here

public function StateTransitionFormFormatter::settingsSummary in State Machine 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/StateTransitionFormFormatter.php, line 176

Class

StateTransitionFormFormatter
Plugin implementation of the 'state_transition_form' formatter.

Namespace

Drupal\state_machine\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  if (!$this
    ->supportsConfirmationForm()) {
    return $summary;
  }
  if ($this
    ->getSetting('require_confirmation')) {
    $summary[] = $this
      ->t('Require confirmation before applying the state transition.');
    if ($this
      ->getSetting('use_modal')) {
      $summary[] = $this
        ->t('Display confirmation in a modal dialog.');
    }
  }
  else {
    $summary[] = $this
      ->t('Do not require confirmation before applying the state transition.');
  }
  return $summary;
}