You are here

public function TagadelicList::buildOptionsForm in Tagadelic 8.3

Provide a form to edit options for this plugin.

Overrides StylePluginBase::buildOptionsForm

File

src/Plugin/views/style/TagadelicList.php, line 64

Class

TagadelicList
Style plugin to render a list of Tagadelic Tags.

Namespace

Drupal\tagadelic\Plugin\views\style

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $options = array(
    '' => $this
      ->t('- None -'),
  );
  $field_labels = $this->displayHandler
    ->getFieldLabels(TRUE);
  $options += $field_labels;
  $handlers = $this->displayHandler
    ->getHandlers('field');
  if (empty($handlers)) {
    $form['error_markup'] = array(
      '#markup' => '<div class="messages messages--error">' . $this
        ->t('You need at least one field before you can configure your table settings') . '</div>',
    );
    return;
  }
  $form['count_field'] = array(
    '#type' => 'select',
    '#title' => $this
      ->t('Count field'),
    '#description' => $this
      ->t('The field that will be used to caculate the text size.'),
    '#options' => $options,
    '#default_value' => $this->options['count_field'],
  );
}