You are here

public function TweetbuttonTweetBlock::blockForm in Tweet Button 8

Overrides \Drupal\block\BlockBase::blockForm().

File

lib/Drupal/tweetbutton/Plugin/Block/TweetbuttonTweetBlock.php, line 55
Contains \Drupal\tweetbutton\Plugin\Block\TweetbuttonTweetBlock.

Class

TweetbuttonTweetBlock
Provides a 'Tweetbutton Tweet' block.

Namespace

Drupal\tweetbutton\Plugin\Block

Code

public function blockForm($form, &$form_state) {
  $form['tweet'] = array(
    '#type' => 'fieldset',
    '#title' => t('Button settings'),
    '#collapsible' => FALSE,
  );
  $form['tweet']['text'] = array(
    '#type' => 'textfield',
    '#title' => t('Tweet text'),
    '#default_value' => $this->configuration['text'],
  );
  $form['tweet']['count'] = array(
    '#type' => 'select',
    '#title' => t('Count box position'),
    '#options' => array(
      'none' => t('None'),
      'horizontal' => t('Horizontal'),
      'vertical' => t('Vertical'),
    ),
    '#default_value' => $this->configuration['count'],
  );
  $form['tweet']['size'] = array(
    '#type' => 'select',
    '#title' => t('Button Size'),
    '#options' => array(
      'medium' => t('Medium'),
      'large' => t('Large'),
    ),
    '#default_value' => $this->configuration['size'],
  );
  $form['tweet']['dnt'] = array(
    '#type' => 'checkbox',
    '#title' => t('Opt-out of tailoring Twitter'),
    '#default_value' => $this->configuration['dnt'],
  );
  return $form;
}