You are here

public function TwitterFeedBlock::blockForm in Twitter_Feed 8

Overrides BlockPluginTrait::blockForm

File

src/Plugin/Block/TwitterFeedBlock.php, line 77

Class

TwitterFeedBlock
Provides a 'TwitterFeedBlock' block.

Namespace

Drupal\twitter_feed\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form['number_of_tweets'] = [
    '#type' => 'number',
    '#title' => $this
      ->t('Number of tweets'),
    '#description' => $this
      ->t('Fetch and display only this number of feeds'),
    '#default_value' => $this->configuration['number_of_tweets'],
  ];
  $form['username'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Username to display'),
    '#description' => $this
      ->t('User to fetch and display tweets'),
    '#default_value' => $this->configuration['username'],
  ];
  $form['display_images'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Display images'),
    '#description' => $this
      ->t('If images embedded in the tweet should be expanded and embedded'),
    '#default_value' => $this->configuration['display_images'],
  ];
  $form['display_avatars'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Display avatars'),
    '#description' => $this
      ->t("If tweeter's avatar should be displayed"),
    '#default_value' => $this->configuration['display_avatars'],
  ];
  return $form;
}