You are here

public function TweetbuttonFollowBlock::blockForm in Tweet Button 8

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

File

lib/Drupal/tweetbutton/Plugin/Block/TweetbuttonFollowBlock.php, line 60
Contains \Drupal\tweetbutton\Plugin\Block\TweetbuttonFollowBlock.

Class

TweetbuttonFollowBlock
Provides a 'Tweetbutton Follow' block.

Namespace

Drupal\tweetbutton\Plugin\Block

Code

public function blockForm($form, &$form_state) {
  $form['follow'] = array(
    '#type' => 'fieldset',
    '#title' => t('Button settings'),
    '#collapsible' => FALSE,
  );
  $form['follow']['show_count'] = array(
    '#type' => 'checkbox',
    '#title' => t('Followers count display'),
    '#default_value' => $this->configuration['show_count'],
  );
  $form['follow']['lang'] = array(
    '#type' => 'select',
    '#title' => t('Language'),
    '#options' => array(
      'en' => t('English'),
      'fr' => t('French'),
      'de' => t('German'),
      'es' => t('Spanish'),
      'ja' => t('Japanese'),
      'auto' => t('Automatic'),
    ),
    '#description' => t('This is the language that the button will render in on your website. People will see the Tweet dialog in their selected language for Twitter.com.'),
    '#default_value' => $this->configuration['lang'],
  );
  $form['follow']['width'] = array(
    '#type' => 'textfield',
    '#title' => t('Width'),
    '#description' => t('Enter the width of the block in pixels.'),
    '#default_value' => $this->configuration['width'],
  );
  $form['follow']['align'] = array(
    '#type' => 'select',
    '#title' => t('Alignment'),
    '#options' => array(
      'none' => t('None'),
      'left' => t('Left'),
      'right' => t('Right'),
    ),
    '#default_value' => $this->configuration['align'],
  );
  $form['follow']['show_screen_name'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show Screen Name'),
    '#default_value' => $this->configuration['show_screen_name'],
  );
  $form['follow']['screen_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Screen Name'),
    '#default_value' => $this->configuration['screen_name'],
    '#description' => t('If you leave the field blank, it will use the global setting of screen name.'),
  );
  $form['follow']['size'] = array(
    '#type' => 'select',
    '#title' => t('Button Size'),
    '#options' => array(
      'medium' => t('Medium'),
      'large' => t('Large'),
    ),
    '#default_value' => $this->configuration['size'],
  );
  $form['follow']['dnt'] = array(
    '#type' => 'checkbox',
    '#title' => t('Opt-out of tailoring Twitter'),
    '#default_value' => $this->configuration['dnt'],
  );
  return $form;
}