You are here

function blazy_field_formatter_settings_form in Blazy 7

Implements hook_field_formatter_settings_form().

File

./blazy.runtime.inc, line 115
Provides basic Blazy integration for lazy loading and multi-serving images.

Code

function blazy_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {

  // The $field is empty at admin/structure/file-types/manage/image/file-display
  // and this form is also loaded there via file_entity_file_formatter_info().
  if (empty($field)) {
    return [];
  }
  $type = in_array($field['type'], BlazyDefault::TEXTS) ? 'text' : $field['type'];
  return blazy('plugin')
    ->getFormatter($type, $field, $instance)
    ->buildSettingsForm($form, $form_state, $view_mode);
}