You are here

private function FotoramaGalleryFormatter::settingsSummaryCheckBoxFields in Fotorama Gallery 8

Construct the summary for each checkbox field.

Parameters

array $summary: Summary array to be fill with the field information.

1 call to FotoramaGalleryFormatter::settingsSummaryCheckBoxFields()
FotoramaGalleryFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/FotoramaGalleryFormatter.php
Returns a short summary for the current formatter settings.

File

src/Plugin/Field/FieldFormatter/FotoramaGalleryFormatter.php, line 324

Class

FotoramaGalleryFormatter
Plugin implementation of the 'fotorama_gallery display' formatter.

Namespace

Drupal\fotorama_gallery\Plugin\Field\FieldFormatter

Code

private function settingsSummaryCheckBoxFields(array &$summary) {
  $check_box_fields = $this->configFactory
    ->get('fotorama_gallery.settings')
    ->get('CheckBoxFields');
  foreach ($check_box_fields as $field) {
    $value = $this
      ->getSetting($field['group'])[$field['key']];
    if ($value != $field['defaultvalue']) {
      $value = $value ? 'true' : 'false';
      $summary[] = $this
        ->t('@label: @value', [
        '@label' => $field['data'],
        '@value' => $value,
      ]);
    }
  }
}