You are here

public function FullCalendar::submitOptionsForm in FullCalendar 8.5

Same name in this branch
  1. 8.5 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar::submitOptionsForm()
  2. 8.5 src/Plugin/fullcalendar/type/FullCalendar.php \Drupal\fullcalendar\Plugin\fullcalendar\type\FullCalendar::submitOptionsForm()
Same name and namespace in other branches
  1. 8 src/Plugin/fullcalendar/type/FullCalendar.php \Drupal\fullcalendar\Plugin\fullcalendar\type\FullCalendar::submitOptionsForm()
  2. 8.2 src/Plugin/fullcalendar/type/FullCalendar.php \Drupal\fullcalendar\Plugin\fullcalendar\type\FullCalendar::submitOptionsForm()
  3. 8.3 src/Plugin/fullcalendar/type/FullCalendar.php \Drupal\fullcalendar\Plugin\fullcalendar\type\FullCalendar::submitOptionsForm()
  4. 8.4 src/Plugin/fullcalendar/type/FullCalendar.php \Drupal\fullcalendar\Plugin\fullcalendar\type\FullCalendar::submitOptionsForm()

Overrides FullcalendarBase::submitOptionsForm

File

src/Plugin/fullcalendar/type/FullCalendar.php, line 963

Class

FullCalendar
Plugin annotation @FullcalendarOption( id = "fullcalendar", module = "fullcalendar", js = TRUE, weight = "-20" )

Namespace

Drupal\fullcalendar\Plugin\fullcalendar\type

Code

public function submitOptionsForm(&$form, FormStateInterface $form_state, &$options = []) {
  $options = $form_state
    ->getValue('style_options');

  // These field options have empty defaults, make sure they stay that way.
  foreach ([
    'title',
    'url',
    'date',
  ] as $field) {
    if (empty($options['fields'][$field]) && isset($options['fields'][$field . '_field'])) {
      unset($options['fields'][$field . '_field']);
    }
  }
}