You are here

public function LogintobogganLoginBlock::blockForm in LoginToboggan 8

Overrides BlockPluginTrait::blockForm

File

src/Plugin/Block/LogintobogganLoginBlock.php, line 65

Class

LogintobogganLoginBlock
Provides a 'LoginToboggan login' block.

Namespace

Drupal\logintoboggan\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form = parent::blockForm($form, $form_state);
  $config = $this
    ->getConfiguration();
  $form['login_display_type'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Block display type'),
    '#options' => [
      $this
        ->t('Standard'),
      $this
        ->t('Link'),
      $this
        ->t('Collapsible form'),
    ],
    '#description' => $this
      ->t("'Standard' is a standard login block, \n      'Link' is a login link that returns the user to the original page after \n      logging in, 'Collapsible form' is a javascript collaspible login form."),
    '#default_value' => isset($config['login_display_type']) ? $config['login_display_type'] : '0',
  ];
  $form['login_block_message'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Message'),
    '#description' => $this
      ->t('Message to display at top of block'),
    '#default_value' => isset($config['login_block_message']) ? $config['login_block_message'] : '',
  ];
  return $form;
}