You are here

function addtocalendar_field_formatter_third_party_settings_form in Add To Calendar Button (AddEvent.com) 8

Same name and namespace in other branches
  1. 8.2 addtocalendar.module \addtocalendar_field_formatter_third_party_settings_form()
  2. 8.3 addtocalendar.module \addtocalendar_field_formatter_third_party_settings_form()

Implements hook_field_formatter_third_party_settings_form().

File

./addtocalendar.module, line 27
Contains module code.

Code

function addtocalendar_field_formatter_third_party_settings_form($plugin, $field_definition, $view_mode, $form, $form_state) {
  $element = [];
  if (count(array_intersect([
    'datetime',
    'daterange',
  ], $plugin
    ->getPluginDefinition()['field_types']))) {
    $settings = $plugin
      ->getThirdPartySettings('addtocalendar');
    $element = _addtocalendar_build_form($settings, $field_definition);
  }
  return $element;
}