You are here

public function SoundCloudWidget::settingsSummary in SoundCloud field 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/SoundCloudWidget.php, line 86

Class

SoundCloudWidget
Plugin implementation of the 'soundcloud_url' widget.

Namespace

Drupal\soundcloudfield\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = array();
  $placeholder_url = $this
    ->getSetting('placeholder_url');
  if (empty($placeholder_url)) {
    $summary[] = $this
      ->t('No placeholders');
  }
  else {
    if (!empty($placeholder_url)) {
      $summary[] = $this
        ->t('URL placeholder: @placeholder_url', array(
        '@placeholder_url' => $placeholder_url,
      ));
    }
  }
  return $summary;
}