You are here

public function ForwardFormBlock::blockForm in Forward 8.2

Overrides BlockPluginTrait::blockForm

File

src/Plugin/Block/ForwardFormBlock.php, line 111

Class

ForwardFormBlock
Provides a block with a Forward form.

Namespace

Drupal\forward\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form = parent::blockForm($form, $form_state);
  $config = $this->configuration;
  $form['body'] = [
    '#type' => 'text_format',
    '#title' => $this
      ->t('Body'),
    '#description' => $this
      ->t('If set, this is placed in the block before the form.'),
  ];
  if (isset($config['body']['value'])) {
    $form['body']['#default_value'] = $config['body']['value'];
    $form['body']['#format'] = $config['body']['format'];
  }
  return $form;
}