You are here

public function TrumbaOpenSpudBlock::blockForm in Trumba 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/Block/TrumbaOpenSpudBlock.php \Drupal\trumba\Plugin\Block\TrumbaOpenSpudBlock::blockForm()

Overrides TrumbaBlockBase::blockForm

File

src/Plugin/Block/TrumbaOpenSpudBlock.php, line 20

Class

TrumbaOpenSpudBlock
Provides a 'TrumbaOpenSpudBlock' block.

Namespace

Drupal\trumba\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $form = parent::blockForm($form, $form_state);
  $form['trumba_spud_url']['#description'] .= ' <strong>' . $this
    ->t('Only necessary if this spud will NOT be on the same page as the main calendar spud! ') . '</strong>';
  $form['trumba_spud_url']['#required'] = FALSE;
  $form['trumba_open_spud_spud_type'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Spud Type'),
    '#description' => $this
      ->t('Enter the name for the type of spud this should be.'),
    '#default_value' => isset($this->configuration['trumba_open_spud_spud_type']) ? $this->configuration['trumba_open_spud_spud_type'] : '',
    '#maxlength' => 255,
    '#size' => 64,
    '#weight' => '1',
    '#required' => TRUE,
  ];
  $form['trumba_open_spud_spud_configuration'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Spud Configuration'),
    '#description' => $this
      ->t('If the spud type requires configuration text enter it here.'),
    '#default_value' => isset($this->configuration['trumba_open_spud_spud_configuration']) ? $this->configuration['trumba_open_spud_spud_configuration'] : '',
    '#maxlength' => 255,
    '#size' => 64,
    '#weight' => '2',
  ];
  return $form;
}