You are here

class FotoramaGalleryFormatter in Fotorama Gallery 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/FotoramaGalleryFormatter.php \Drupal\fotorama_gallery\Plugin\Field\FieldFormatter\FotoramaGalleryFormatter

Plugin implementation of the 'fotorama_gallery display' formatter.

Plugin annotation


@FieldFormatter(
  id = "fotorama_gallery",
  label = @Translation("Fotorama"),
  field_types = {
    "image"
  }
)

Hierarchy

Expanded class hierarchy of FotoramaGalleryFormatter

File

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

Namespace

Drupal\fotorama_gallery\Plugin\Field\FieldFormatter
View source
class FotoramaGalleryFormatter extends ImageFormatter {

  /**
   * Options for fit field.
   *
   * @var array
   */
  protected $fitOptions = [
    'contain',
    'cover',
    'scaledownn',
    'none',
  ];

  /**
   * Options for nav field.
   *
   * @var array
   */
  protected $navOptions = [
    'dots',
    'thumbs',
    'false',
  ];

  /**
   * Options for nav position field.
   *
   * @var array
   */
  protected $navPositionOptions = [
    'bottom',
    'top',
  ];

  /**
   * Options for transition field.
   *
   * @var array
   */
  protected $transitionOptions = [
    'slide',
    'crossfade',
    'dissolve',
  ];

  /**
   * Options for click transition field.
   *
   * @var array
   */
  protected $clickTransitionOptions = [
    'slide',
    'crossfade',
    'dissolve',
  ];

  /**
   * Options for allowfullscreen field.
   *
   * @var array
   */
  protected $allowFullScreenOptions = [
    'false',
    'true',
    'native',
  ];

  /**
   * Options for allowfullscreen field.
   *
   * @var array
   */
  protected $arrowsOptions = [
    'true',
    'false',
    'always',
  ];

  /**
   * {@inheritdoc}
   */
  public static function defaultSettings() {
    return [
      'dimensions' => [],
      'others' => [
        'fit' => 0,
        'allowfullscreen' => 0,
        'loop' => TRUE,
        'shuffle' => TRUE,
        'keyboard' => TRUE,
        'arrows' => 0,
        'click' => TRUE,
        'swipe' => TRUE,
        'trackpad' => TRUE,
      ],
      'autoplay' => [
        'stopautoplayontouch' => FALSE,
      ],
      'navigation' => [
        'nav' => 0,
        'navposition' => 0,
      ],
      'transition' => [
        'transition' => 0,
      ],
    ] + parent::defaultSettings();
  }

  /**
   * {@inheritdoc}
   */
  public function settingsForm(array $form, FormStateInterface $form_state) {
    $element = parent::settingsForm($form, $form_state);
    unset($element['image_link']);
    $url_options = [
      'attributes' => [
        'target' => '_blank',
      ],
    ];
    $base_path_doc = 'https://fotorama.io/docs/4';
    $dimensions = $this
      ->getSettings()['dimensions'];
    $others = $this
      ->getSettings()['others'];
    $autoplay = $this
      ->getSettings()['autoplay'];
    $navigation = $this
      ->getSettings()['navigation'];
    $transition = $this
      ->getSettings()['transition'];

    // Field groups.
    $element['dimensions'] = [
      '#type' => 'details',
      '#title' => $this
        ->t('Dimensions'),
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: Dimensions'), Url::fromUri($base_path_doc . '/dimensions/', $url_options)),
    ];
    $element['dimensions']['ratio'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Ratio'),
      '#size' => 10,
      '#default_value' => isset($dimensions['ratio']) ? $dimensions['ratio'] : '',
      '#description' => $this
        ->t('Ex. 4/3 , 16/9'),
    ];
    $element['dimensions']['width'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('data-width'),
      '#size' => 10,
      '#default_value' => isset($dimensions['width']) ? $dimensions['width'] : '',
    ];
    $element['dimensions']['maxwidth'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('data-maxwidth'),
      '#size' => 10,
      '#default_value' => isset($dimensions['maxwidth']) ? $dimensions['maxwidth'] : '',
    ];
    $element['dimensions']['minwidth'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('data-minwidth'),
      '#size' => 10,
      '#default_value' => isset($dimensions['minwidth']) ? $dimensions['minwidth'] : '',
    ];
    $element['dimensions']['height'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('data-Height'),
      '#size' => 10,
      '#default_value' => isset($dimensions['height']) ? $dimensions['height'] : '',
    ];
    $element['dimensions']['maxheight'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('data-maxheight'),
      '#size' => 10,
      '#default_value' => isset($dimensions['maxheight']) ? $dimensions['maxheight'] : '',
    ];
    $element['dimensions']['minheight'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('data-minheight'),
      '#size' => 10,
      '#default_value' => isset($dimensions['minheight']) ? $dimensions['minheight'] : '',
    ];
    $element['others'] = [
      '#type' => 'details',
      '#title' => $this
        ->t('Others'),
    ];
    $element['others']['fit'] = [
      '#type' => 'select',
      '#title' => $this
        ->t('data-fit'),
      '#options' => $this->fitOptions,
      '#default_value' => $others['fit'],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-fit'), Url::fromUri($base_path_doc . '/fit/', $url_options)),
    ];
    $element['others']['allowfullscreen'] = [
      '#type' => 'select',
      '#title' => 'data-allowfullscreen',
      '#options' => $this->allowFullScreenOptions,
      '#default_value' => isset($others['allowfullscreen']) ? $others['allowfullscreen'] : 'false',
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-allowfullscreen'), Url::fromUri($base_path_doc . '/allowfullscreen/', $url_options)),
    ];
    $element['others']['loop'] = [
      '#type' => 'checkbox',
      '#title' => 'data-loop',
      '#default_value' => $others['loop'],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-loop'), Url::fromUri($base_path_doc . '/loop/', $url_options)),
    ];
    $element['others']['shuffle'] = [
      '#type' => 'checkbox',
      '#title' => 'data-shuffle',
      '#default_value' => $others['shuffle'],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-shuffle'), Url::fromUri($base_path_doc . '/shuffle/', $url_options)),
    ];
    $element['others']['keyboard'] = [
      '#type' => 'checkbox',
      '#title' => 'data-keyboard',
      '#default_value' => $others['keyboard'],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-keyboard'), Url::fromUri($base_path_doc . '/keyboard/', $url_options)),
    ];
    $element['others']['arrows'] = [
      '#type' => 'select',
      '#title' => 'data-arrows',
      '#options' => $this->arrowsOptions,
      '#default_value' => $others['arrows'],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-arrows'), Url::fromUri($base_path_doc . '/arrows-click-swipe/', $url_options)),
    ];
    $element['others']['click'] = [
      '#type' => 'checkbox',
      '#title' => 'data-click',
      '#default_value' => $others['click'],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-click'), Url::fromUri($base_path_doc . '/arrows-click-swipe/', $url_options)),
    ];
    $element['others']['swipe'] = [
      '#type' => 'checkbox',
      '#title' => 'data-swipe',
      '#default_value' => $others['swipe'],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-swipe'), Url::fromUri($base_path_doc . '/arrows-click-swipe/', $url_options)),
    ];
    $element['others']['trackpad'] = [
      '#type' => 'checkbox',
      '#title' => 'data-trackpad',
      '#default_value' => $others['trackpad'],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-trackpad'), Url::fromUri($base_path_doc . '/arrows-click-swipe/', $url_options)),
    ];
    $element['autoplay'] = [
      '#type' => 'details',
      '#title' => $this
        ->t('Autoplay'),
    ];
    $element['autoplay']['stopautoplayontouch'] = [
      '#type' => 'checkbox',
      '#title' => 'data-stopautoplayontouch',
      '#default_value' => $autoplay['stopautoplayontouch'],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-stopautoplayontouch'), Url::fromUri($base_path_doc . '/autoplay/', $url_options)),
    ];
    $element['navigation'] = [
      '#type' => 'details',
      '#title' => $this
        ->t('Navigation'),
    ];
    $element['navigation']['nav'] = [
      '#type' => 'select',
      '#title' => $this
        ->t('data-nav'),
      '#options' => $this->navOptions,
      '#default_value' => $navigation['nav'],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-nav'), Url::fromUri($base_path_doc . '/thumbnails/', $url_options)),
    ];
    $element['navigation']['navposition'] = [
      '#type' => 'select',
      '#title' => $this
        ->t('data-navposition'),
      '#options' => $this->navPositionOptions,
      '#default_value' => $navigation['navposition'],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-navposition'), Url::fromUri($base_path_doc . '/navigation-position/', $url_options)),
    ];
    $element['transition'] = [
      '#type' => 'details',
      '#title' => $this
        ->t('Transition'),
    ];
    $element['transition']['transition'] = [
      '#type' => 'select',
      '#title' => $this
        ->t('data-transition'),
      '#options' => $this->transitionOptions,
      '#default_value' => $transition['transition'],
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-transition'), Url::fromUri($base_path_doc . '/transition/', $url_options)),
    ];
    $element['transition']['clicktransition'] = [
      '#type' => 'select',
      '#title' => $this
        ->t('data-clicktransition'),
      '#options' => $this->clickTransitionOptions,
      '#default_value' => isset($transition['clicktransition']) ? $transition['clicktransition'] : '',
      '#description' => Link::fromTextAndUrl($this
        ->t('Documentation: data-clicktransition'), Url::fromUri($base_path_doc . '/transition/', $url_options)),
    ];
    return $element;
  }

  /**
   * {@inheritdoc}
   */
  public function settingsSummary() {
    $summary = parent::settingsSummary();
    array_unshift($summary, "Fotorama Gallery Settings");
    $dimensions = $this
      ->getSettings()['dimensions'];
    $others = $this
      ->getSettings()['others'];
    $autoplay = $this
      ->getSettings()['autoplay'];
    $navigation = $this
      ->getSettings()['navigation'];
    $transition = $this
      ->getSettings()['transition'];
    if (!empty($dimensions['ratio'])) {
      $summary[] = $this
        ->t('data-ratio: @value', [
        '@value' => $dimensions['ratio'],
      ]);
    }
    if (!empty($dimensions['width'])) {
      $summary[] = $this
        ->t('data-width: @value', [
        '@value' => $dimensions['width'],
      ]);
    }
    if (!empty($dimensions['maxwidth'])) {
      $summary[] = $this
        ->t('data-maxwidth: @value', [
        '@value' => $dimensions['maxwidth'],
      ]);
    }
    if (!empty($dimensions['minwidth'])) {
      $summary[] = $this
        ->t('data-minwidth: @value', [
        '@value' => $dimensions['minwidth'],
      ]);
    }
    if (!empty($dimensions['height'])) {
      $summary[] = $this
        ->t('data-height: @value', [
        '@value' => $dimensions['height'],
      ]);
    }
    if (!empty($dimensions['maxheight'])) {
      $summary[] = $this
        ->t('data-maxheight: @value', [
        '@value' => $dimensions['maxheight'],
      ]);
    }
    if (!empty($dimensions['minheight'])) {
      $summary[] = $this
        ->t('data-minheight: @value', [
        '@value' => $dimensions['minheight'],
      ]);
    }
    $summary[] = $this
      ->t('data-fit: @value', [
      '@value' => $this->fitOptions[$others['fit']],
    ]);
    $summary[] = $this
      ->t('data-allowfullscreen: @value', [
      '@value' => !empty($others['allowfullscreen']) ? $this->allowFullScreenOptions[$others['allowfullscreen']] : 'false',
    ]);
    $summary[] = $this
      ->t('data-loop: @value', [
      '@value' => $others['loop'] ? 'true' : 'false',
    ]);
    $summary[] = $this
      ->t('data-shuffle: @value', [
      '@value' => $others['shuffle'] ? 'true' : 'false',
    ]);
    $summary[] = $this
      ->t('data-keyboard: @value', [
      '@value' => $others['keyboard'] ? 'true' : 'false',
    ]);
    $summary[] = $this
      ->t('data-arrows: @value', [
      '@value' => $this->arrowsOptions[$others['arrows']],
    ]);
    $summary[] = $this
      ->t('data-click: @value', [
      '@value' => $others['click'] ? 'true' : 'false',
    ]);
    $summary[] = $this
      ->t('data-swipe: @value', [
      '@value' => $others['swipe'] ? 'true' : 'false',
    ]);
    $summary[] = $this
      ->t('data-trackpad: @value', [
      '@value' => $others['trackpad'] ? 'true' : 'false',
    ]);
    $summary[] = $this
      ->t('data-stopautoplayontouch: @value', [
      '@value' => $autoplay['stopautoplayontouch'] ? 'true' : 'false',
    ]);
    if (!empty($navigation['nav'])) {
      $summary[] = $this
        ->t('data-nav: @value', [
        '@value' => $this->navOptions[$navigation['nav']],
      ]);
    }
    if (!empty($navigation['navposition'])) {
      $summary[] = $this
        ->t('data-navposition: @value', [
        '@value' => $this->navPositionOptions[$navigation['navposition']],
      ]);
    }
    if (!empty($transition['transition'])) {
      $summary[] = $this
        ->t('data-transition: @value', [
        '@value' => $this->transitionOptions[$transition['transition']],
      ]);
    }
    if (!empty($transition['clicktransition'])) {
      $summary[] = $this
        ->t('data-clicktransition: @value', [
        '@value' => $this->clickTransitionOptions[$transition['clicktransition']],
      ]);
    }
    return $summary;
  }

  /**
   * {@inheritdoc}
   */
  public function viewElements(FieldItemListInterface $items, $langcode) {
    $elements = [];
    $files = $this
      ->getEntitiesToView($items, $langcode);

    // Early opt-out if the field is empty.
    if (empty($files)) {
      return $elements;
    }

    // Get all settings.
    $dimensions = $this
      ->getSettings()['dimensions'];
    $others = $this
      ->getSettings()['others'];
    $autoplay = $this
      ->getSettings()['autoplay'];
    $navigation = $this
      ->getSettings()['navigation'];
    $transition = $this
      ->getSettings()['transition'];
    $image_url = NULL;

    // Load image style storage object.
    $image_style_setting = $this
      ->getSetting('image_style');
    $image_style = $this->imageStyleStorage
      ->load($image_style_setting);

    // Check if thumbs option is enabled.
    $thumbs = $navigation['nav'] === 1;

    // Get thumb style storage.
    $thumb_style = FALSE;
    if ($thumbs) {
      $image_style_thumbs_setting = 'thumbnail';
      $thumb_style = $this->imageStyleStorage
        ->load($image_style_thumbs_setting);
    }

    // Collect cache tags to be added for each item in the field.
    $base_cache_tags = [];
    if ($image_style) {
      $base_cache_tags = $image_style
        ->getCacheTags();
    }
    if ($thumb_style) {
      $base_cache_tags = $thumb_style
        ->getCacheTags();
    }
    foreach ($files as $delta => $file) {
      $cache_contexts = [];
      $image_uri = $file
        ->getFileUri();
      $url = $image_style ? $image_style
        ->buildUrl($image_uri) : file_create_url($image_uri);
      $image_url = URL::fromUri($url);

      // Generate Thumbs.
      if ($thumbs) {
        $thumb_uri = $thumb_style
          ->buildUrl($image_uri);
        $thumb_url = URL::fromUri($thumb_uri)
          ->toString();
        $thumb = [
          'data-thumb' => $thumb_url,
        ];
      }
      $cache_contexts[] = 'url.site';
      $cache_tags = Cache::mergeTags($base_cache_tags, $file
        ->getCacheTags());
      $elements[$delta] = [
        '#type' => 'link',
        '#title' => '',
        '#url' => $image_url,
        '#attributes' => isset($thumb) ? $thumb : [],
        '#cache' => [
          'tags' => $cache_tags,
          'contexts' => $cache_contexts,
        ],
      ];
    }

    // Add custom settings to the Fotorama gallery.
    $elements['#theme'] = 'fotorama_gallery_field';
    if (!empty($dimensions['ratio'])) {
      $elements['attributes']['data-ratio'] = $dimensions['ratio'];
    }
    if (!empty($dimensions['width'])) {
      $elements['attributes']['data-width'] = $dimensions['width'];
    }
    if (!empty($dimensions['maxwidth'])) {
      $elements['attributes']['data-maxwidth'] = $dimensions['maxwidth'];
    }
    if (!empty($dimensions['minwidth'])) {
      $elements['attributes']['data-minwidth'] = $dimensions['minwidth'];
    }
    if (!empty($dimensions['height'])) {
      $elements['attributes']['data-height'] = $dimensions['height'];
    }
    if (!empty($dimensions['maxheight'])) {
      $elements['attributes']['data-maxheight'] = $dimensions['maxheight'];
    }
    if (!empty($dimensions['minheight'])) {
      $elements['attributes']['data-minheight'] = $dimensions['minheight'];
    }
    if (!empty($others['fit'])) {
      $elements['attributes']['data-fit'] = $this->fitOptions[$others['fit']];
    }
    if (!empty($others['allowfullscreen']) && $others['allowfullscreen']) {
      $elements['attributes']['data-allowfullscreen'] = $this->allowFullScreenOptions[$others['allowfullscreen']];
    }
    $elements['attributes']['data-loop'] = $others['loop'] ? 'true' : 'false';
    $elements['attributes']['data-shuffle'] = $others['shuffle'] ? 'true' : 'false';
    $elements['attributes']['data-keyboard'] = $others['keyboard'] ? 'true' : 'false';
    if (!empty($others['arrows'])) {
      $elements['attributes']['data-arrows'] = $this->arrowsOptions[$others['arrows']];
    }
    $elements['attributes']['data-click'] = $others['click'] ? 'true' : 'false';
    $elements['attributes']['data-swipe'] = $others['swipe'] ? 'true' : 'false';
    $elements['attributes']['data-trackpad'] = $others['trackpad'] ? 'true' : 'false';
    $elements['attributes']['data-stopautoplayontouch'] = $autoplay['stopautoplayontouch'] ? 'true' : 'false';
    if (!empty($navigation['nav'])) {
      $elements['attributes']['data-nav'] = $this->navOptions[$navigation['nav']];
    }
    if (!empty($navigation['navposition'])) {
      $elements['attributes']['data-navposition'] = $this->navPositionOptions[$navigation['navposition']];
    }
    if (!empty($transition['transition'])) {
      $elements['attributes']['data-transition'] = $this->transitionOptions[$transition['transition']];
    }
    if (!empty($transition['clicktransition'])) {
      $elements['attributes']['data-clicktransition'] = $this->clickTransitionOptions[$transition['clicktransition']];
    }
    return $elements;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
EntityReferenceFormatterBase::prepareView public function Loads the entities referenced in that field across all the entities being viewed. Overrides FormatterBase::prepareView
EntityReferenceFormatterBase::view public function Overrides FormatterBase::view
FileFormatterBase::checkAccess protected function Checks access to the given entity. Overrides EntityReferenceFormatterBase::checkAccess
FileFormatterBase::needsEntityLoad protected function Returns whether the entity referenced by an item needs to be loaded. Overrides EntityReferenceFormatterBase::needsEntityLoad 1
FormatterBase::$fieldDefinition protected property The field definition.
FormatterBase::$label protected property The label display setting.
FormatterBase::$settings protected property The formatter settings. Overrides PluginSettingsBase::$settings
FormatterBase::$viewMode protected property The view mode.
FormatterBase::getFieldSetting protected function Returns the value of a field setting.
FormatterBase::getFieldSettings protected function Returns the array of field settings.
FormatterBase::isApplicable public static function Returns if the formatter can be used for the provided field. Overrides FormatterInterface::isApplicable 14
FotoramaGalleryFormatter::$allowFullScreenOptions protected property Options for allowfullscreen field.
FotoramaGalleryFormatter::$arrowsOptions protected property Options for allowfullscreen field.
FotoramaGalleryFormatter::$clickTransitionOptions protected property Options for click transition field.
FotoramaGalleryFormatter::$fitOptions protected property Options for fit field.
FotoramaGalleryFormatter::$navOptions protected property Options for nav field.
FotoramaGalleryFormatter::$navPositionOptions protected property Options for nav position field.
FotoramaGalleryFormatter::$transitionOptions protected property Options for transition field.
FotoramaGalleryFormatter::defaultSettings public static function Defines the default settings for this plugin. Overrides ImageFormatter::defaultSettings
FotoramaGalleryFormatter::settingsForm public function Returns a form to configure settings for the formatter. Overrides ImageFormatter::settingsForm
FotoramaGalleryFormatter::settingsSummary public function Returns a short summary for the current formatter settings. Overrides ImageFormatter::settingsSummary
FotoramaGalleryFormatter::viewElements public function Builds a renderable array for a field value. Overrides ImageFormatter::viewElements
ImageFormatter::$currentUser protected property The current user.
ImageFormatter::$imageStyleStorage protected property The image style entity storage.
ImageFormatter::calculateDependencies public function Calculates dependencies for the configured plugin. Overrides PluginSettingsBase::calculateDependencies
ImageFormatter::create public static function Creates an instance of the plugin. Overrides FormatterBase::create 1
ImageFormatter::onDependencyRemoval public function Informs the plugin that some configuration it depends on will be deleted. Overrides PluginSettingsBase::onDependencyRemoval
ImageFormatter::__construct public function Constructs an ImageFormatter object. Overrides FormatterBase::__construct 1
ImageFormatterBase::getEntitiesToView protected function Returns the referenced entities for display. Overrides EntityReferenceFormatterBase::getEntitiesToView
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginSettingsBase::$defaultSettingsMerged protected property Whether default settings have been merged into the current $settings.
PluginSettingsBase::$thirdPartySettings protected property The plugin settings injected by third party modules.
PluginSettingsBase::getSetting public function Returns the value of a setting, or its default value if absent. Overrides PluginSettingsInterface::getSetting
PluginSettingsBase::getSettings public function Returns the array of settings, including defaults for missing settings. Overrides PluginSettingsInterface::getSettings
PluginSettingsBase::getThirdPartyProviders public function Gets the list of third parties that store information. Overrides ThirdPartySettingsInterface::getThirdPartyProviders
PluginSettingsBase::getThirdPartySetting public function Gets the value of a third-party setting. Overrides ThirdPartySettingsInterface::getThirdPartySetting
PluginSettingsBase::getThirdPartySettings public function Gets all third-party settings of a given module. Overrides ThirdPartySettingsInterface::getThirdPartySettings
PluginSettingsBase::mergeDefaults protected function Merges default settings values into $settings.
PluginSettingsBase::setSetting public function Sets the value of a setting for the plugin. Overrides PluginSettingsInterface::setSetting
PluginSettingsBase::setSettings public function Sets the settings for the plugin. Overrides PluginSettingsInterface::setSettings
PluginSettingsBase::setThirdPartySetting public function Sets the value of a third-party setting. Overrides ThirdPartySettingsInterface::setThirdPartySetting
PluginSettingsBase::unsetThirdPartySetting public function Unsets a third-party setting. Overrides ThirdPartySettingsInterface::unsetThirdPartySetting
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.