You are here

private function FotoramaGalleryFormatter::settingsSummaryNumberFields in Fotorama Gallery 8

Construct the summary for each dimension field.

Parameters

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

1 call to FotoramaGalleryFormatter::settingsSummaryNumberFields()
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 302

Class

FotoramaGalleryFormatter
Plugin implementation of the 'fotorama_gallery display' formatter.

Namespace

Drupal\fotorama_gallery\Plugin\Field\FieldFormatter

Code

private function settingsSummaryNumberFields(array &$summary) {
  $dimensions_fields = $this->configFactory
    ->get('fotorama_gallery.settings')
    ->get('NumberFields');
  foreach ($dimensions_fields as $field) {
    $value = $this
      ->getSetting('dimensions')[$field['key']];
    $value_formatted = $this
      ->getNumberFieldsValuePercent($field['key'], $field['percent']);
    if (!empty($value)) {
      $summary[] = $this
        ->t('@label: @value', [
        '@label' => $field['data'],
        '@value' => $value_formatted,
      ]);
    }
  }
}