You are here

public function AceFormatter::settingsSummary in Ace Code Editor 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/AceFormatter.php, line 90

Class

AceFormatter
Plugin implementation of the 'ace_editor' formatter.

Namespace

Drupal\ace_editor\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $settings = $this
    ->getSettings();
  $summary = [];
  $summary[] = t('Theme:') . ' ' . $settings['theme'];
  $summary[] = t('Syntax:') . ' ' . $settings['syntax'];
  $summary[] = t('Height:') . ' ' . $settings['height'];
  $summary[] = t('Width:') . ' ' . $settings['width'];
  $summary[] = t('Font size:') . ' ' . $settings['font_size'];
  $summary[] = t('Show line numbers:') . ' ' . ($settings['line_numbers'] ? t('On') : t('Off'));
  $summary[] = t('Show print margin:') . ' ' . ($settings['print_margins'] ? t('On') : t('Off'));
  $summary[] = t('Show invisible characters:') . ' ' . ($settings['show_invisibles'] ? t('On') : t('Off'));
  $summary[] = t('Toggle word wrapping:') . ' ' . ($settings['use_wrap_mode'] ? t('On') : t('Off'));
  return $summary;
}