You are here

private function FotoramaGalleryFormatter::settingsFormCheckBoxFields in Fotorama Gallery 8

Fill $element with the Checkbox fields information from the settings.

Parameters

array $element: Form elements.

array $url_options: Url attributes.

1 call to FotoramaGalleryFormatter::settingsFormCheckBoxFields()
FotoramaGalleryFormatter::settingsForm in src/Plugin/Field/FieldFormatter/FotoramaGalleryFormatter.php
Returns a form to configure settings for the formatter.

File

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

Class

FotoramaGalleryFormatter
Plugin implementation of the 'fotorama_gallery display' formatter.

Namespace

Drupal\fotorama_gallery\Plugin\Field\FieldFormatter

Code

private function settingsFormCheckBoxFields(array &$element, array $url_options) {
  $check_box_fields = $this->configFactory
    ->get('fotorama_gallery.settings')
    ->get('CheckBoxFields');
  foreach ($check_box_fields as $field) {
    $element[$field['group']][$field['key']] = [
      '#type' => 'checkbox',
      '#title' => $field['data'],
      '#default_value' => $this
        ->getSetting($field['group'])[$field['key']],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: @field', [
        '@field' => $field['data'],
      ]), Url::fromUri($field['documentation'], $url_options)),
    ];
  }
}