You are here

function lazy_field_formatter_third_party_settings_form in Lazy-load 8.2

Same name and namespace in other branches
  1. 8.3 lazy.module \lazy_field_formatter_third_party_settings_form()
  2. 8 lazy.module \lazy_field_formatter_third_party_settings_form()

Implements hook_field_formatter_third_party_settings_form().

File

./lazy.module, line 153
Module file for Lazy-load.

Code

function lazy_field_formatter_third_party_settings_form($plugin) {
  $element = [];
  if (in_array($plugin
    ->getPluginId(), lazy_field_types(), TRUE)) {
    $element['lazy_image'] = [
      '#type' => 'checkbox',
      '#title' => t('Enable lazy-loading'),
      '#default_value' => $plugin
        ->getThirdPartySetting('lazy', 'lazy_image', FALSE),
    ];
  }
  return $element;
}