You are here

public function SocialSimpleBlock::blockForm in Social simple 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Block/SocialSimpleBlock.php \Drupal\social_simple\Plugin\Block\SocialSimpleBlock::blockForm()

Overrides BlockPluginTrait::blockForm

File

src/Plugin/Block/SocialSimpleBlock.php, line 108

Class

SocialSimpleBlock
Provides a 'SocialSimpleBlock' block.

Namespace

Drupal\social_simple\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form['social_share_title'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Social share title'),
    '#description' => $this
      ->t('Set the title to use before the social links displayed'),
    '#default_value' => $this->configuration['social_share_title'],
    '#maxlength' => 255,
    '#size' => 64,
    '#weight' => 1,
  ];
  $options = $this->socialSimpleGenerator
    ->getNetworks();
  $form['social_networks'] = [
    '#type' => 'checkboxes',
    '#title' => $this
      ->t('Social networks'),
    '#description' => $this
      ->t('Select the social network share link to display'),
    '#options' => $options,
    '#default_value' => $this->configuration['social_networks'],
    '#weight' => 2,
  ];
  return $form;
}