You are here

public function StarsWidget::settingsSummary in Fivestar 8

Returns a short summary for the current widget settings.

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

Return value

array A short summary of the widget settings.

Overrides WidgetBase::settingsSummary

File

src/Plugin/Field/FieldWidget/StarsWidget.php, line 54

Class

StarsWidget
Plugin implementation of the 'fivestar_stars' widget.

Namespace

Drupal\fivestar\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary[] = $this
    ->t('Style: @widget', [
    '@widget' => $this->widgetManager
      ->getWidgetLabel($this
      ->getSelectedWidgetKey()),
  ]);
  $summary[] = $this
    ->t('Stars display: @style, Text display: @text', [
    '@style' => $this
      ->getSetting('display_format'),
    '@text' => $this
      ->getSetting('text_format'),
  ]);
  return $summary;
}