You are here

public function TrumbaPromoControlSpudBlock::blockForm in Trumba 8

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

Overrides TrumbaBlockBase::blockForm

File

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

Class

TrumbaPromoControlSpudBlock
Provides a 'TrumbaPromoControlSpudBlock' 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_promo_control_spud_type'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Spud Type'),
    '#description' => $this
      ->t('Select the type of spud this should be.'),
    '#options' => array(
      'upcoming' => $this
        ->t('Upcoming'),
      'datefinder' => $this
        ->t('Date Finder'),
      'daysummary' => $this
        ->t('Day Summary'),
      'searchlabeled' => $this
        ->t('Search'),
      'monthlist' => $this
        ->t('Month List'),
      'tabchooser' => $this
        ->t('View Chooser Tabbed'),
      'filter' => $this
        ->t('filter'),
    ),
    '#default_value' => isset($this->configuration['trumba_promo_control_spud_type']) ? $this->configuration['trumba_promo_control_spud_type'] : '',
    '#size' => 1,
    '#weight' => '1',
    '#required' => TRUE,
    '#empty_value' => '',
    '#empty_option' => t('- Select -'),
  ];
  $form['trumba_promo_control_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_promo_control_spud_configuration']) ? $this->configuration['trumba_promo_control_spud_configuration'] : '',
    '#maxlength' => 255,
    '#size' => 64,
    '#weight' => '2',
  ];
  return $form;
}