You are here

public function DisqusCombinationWidgetBlock::blockForm in Disqus 8

Overrides DisqusBaseBlock::blockForm

File

src/Plugin/Block/DisqusCombinationWidgetBlock.php, line 45

Class

DisqusCombinationWidgetBlock
Plugin implementation of the 'disqus_combination_widget'.

Namespace

Drupal\disqus\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form = parent::blockForm($form, $form_state);
  $form['disqus']['color_theme'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Color Theme'),
    '#options' => [
      'blue' => $this
        ->t('Blue'),
      'grey' => $this
        ->t('Grey'),
      'green' => $this
        ->t('Green'),
      'red' => $this
        ->t('Red'),
      'orange' => $this
        ->t('Orange'),
    ],
    '#default_value' => $this->configuration['color_theme'],
  ];
  $form['disqus']['default_tab_view'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Default Tab View'),
    '#options' => [
      'people' => $this
        ->t('People'),
      'recent' => $this
        ->t('Recent'),
      'popular' => $this
        ->t('Popular'),
    ],
    '#default_value' => $this->configuration['default_tab_view'],
  ];
  $form['disqus']['excerpt_length'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Comment Except Length'),
    '#default_value' => $this->configuration['excerpt_length'],
    '#size' => 4,
  ];
  $form['disqus']['hide_mods'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Hide moderators in ranking'),
    '#default_value' => $this->configuration['hide_mods'],
  ];
  return $form;
}