function FileMediaFormatterBase::settingsSummary

Same name in other branches
  1. 9 core/modules/file/src/Plugin/Field/FieldFormatter/FileMediaFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\FileMediaFormatterBase::settingsSummary()
  2. 10 core/modules/file/src/Plugin/Field/FieldFormatter/FileMediaFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\FileMediaFormatterBase::settingsSummary()
  3. 11.x core/modules/file/src/Plugin/Field/FieldFormatter/FileMediaFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\FileMediaFormatterBase::settingsSummary()

Overrides FormatterBase::settingsSummary

1 call to FileMediaFormatterBase::settingsSummary()
FileVideoFormatter::settingsSummary in core/modules/file/src/Plugin/Field/FieldFormatter/FileVideoFormatter.php
Returns a short summary for the current formatter settings.
1 method overrides FileMediaFormatterBase::settingsSummary()
FileVideoFormatter::settingsSummary in core/modules/file/src/Plugin/Field/FieldFormatter/FileVideoFormatter.php
Returns a short summary for the current formatter settings.

File

core/modules/file/src/Plugin/Field/FieldFormatter/FileMediaFormatterBase.php, line 95

Class

FileMediaFormatterBase
Base class for media file formatter.

Namespace

Drupal\file\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
    $summary = [];
    $summary[] = $this->t('Playback controls: %controls', [
        '%controls' => $this->getSetting('controls') ? $this->t('visible') : $this->t('hidden'),
    ]);
    $summary[] = $this->t('Autoplay: %autoplay', [
        '%autoplay' => $this->getSetting('autoplay') ? $this->t('yes') : $this->t('no'),
    ]);
    $summary[] = $this->t('Loop: %loop', [
        '%loop' => $this->getSetting('loop') ? $this->t('yes') : $this->t('no'),
    ]);
    switch ($this->getSetting('multiple_file_display_type')) {
        case 'tags':
            $summary[] = $this->t('Multiple file display: Multiple HTML tags');
            break;
        case 'sources':
            $summary[] = $this->t('Multiple file display: One HTML tag with multiple sources');
            break;
    }
    return $summary;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.