You are here

public function SimpleTimeline::buildOptionsForm in A Simple Timeline 8

Render the given style.

Overrides StylePluginBase::buildOptionsForm

File

src/Plugin/views/style/SimpleTimeline.php, line 61

Class

SimpleTimeline
Style plugin to render each item in an ordered or unordered list.

Namespace

Drupal\simple_timeline\Plugin\views\style

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['position_items'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Items position'),
    '#options' => [
      'alternate' => $this
        ->t('Alternate position (contents are alternated (left and right, etc.) around the timeline)'),
      'left' => $this
        ->t('Left position (contents are positionned to the left of the timeline)'),
      'right' => $this
        ->t('Right position (contents are positionned to the right of the timeline)'),
    ],
    '#default_value' => $this->options['position_items'],
    '#description' => $this
      ->t('Select the position of contents around the timeline.'),
  ];
  $form['position_marker'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Marker position'),
    '#options' => [
      'marker-top' => $this
        ->t('Top'),
      'marker-center' => $this
        ->t('Center'),
      'marker-bottom' => $this
        ->t('Bottom'),
    ],
    '#default_value' => $this->options['position_marker'],
    '#description' => $this
      ->t('Select the marker position relative to the element.'),
  ];
  $form['wrapper_class'] = [
    '#title' => $this
      ->t('Wrapper class'),
    '#description' => $this
      ->t('The class to provide on the wrapper, outside the list.'),
    '#type' => 'textfield',
    '#size' => '30',
    '#default_value' => $this->options['wrapper_class'],
  ];
  $form['class'] = [
    '#title' => $this
      ->t('List class'),
    '#description' => $this
      ->t('The class to provide on the list element itself.'),
    '#type' => 'textfield',
    '#size' => '30',
    '#default_value' => $this->options['class'],
  ];
}