You are here

public function GoogleCalendar::buildOptionsForm in FullCalendar 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/views/field/GoogleCalendar.php \Drupal\fullcalendar\Plugin\views\field\GoogleCalendar::buildOptionsForm()

Default options form that provides the label widget that all fields should have.

Overrides FieldPluginBase::buildOptionsForm

File

src/Plugin/views/field/GoogleCalendar.php, line 58

Class

GoogleCalendar
TODO

Namespace

Drupal\fullcalendar\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  $form['label'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Label'),
    '#default_value' => isset($this->options['label']) ? $this->options['label'] : '',
    '#description' => $this
      ->t('The label for this field that will be displayed to end users if the style requires it.'),
  ];
  $form['gcal'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Feed URL'),
    '#maxlength' => 1024,
    '#default_value' => $this->options['gcal'],
  ];
  $form['class'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('CSS class'),
    '#default_value' => $this->options['class'],
  ];
  $form['timezone'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Time zone'),
    '#default_value' => $this->options['timezone'],
    '#options' => system_time_zones(),
    '#attributes' => [
      'class' => [
        'timezone-detect',
      ],
    ],
  ];
}