You are here

public function CampaignMonitorSubscribeBlock::blockSubmit in Campaign Monitor 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Block/CampaignMonitorSubscribeBlock.php \Drupal\campaignmonitor\Plugin\Block\CampaignMonitorSubscribeBlock::blockSubmit()

Adds block type-specific submission handling for the block form.

Note that this method takes the form structure and form state for the full block configuration form as arguments, not just the elements defined in BlockPluginInterface::blockForm().

Parameters

array $form: The form definition array for the full block configuration form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides BlockPluginTrait::blockSubmit

See also

\Drupal\Core\Block\BlockPluginInterface::blockForm()

\Drupal\Core\Block\BlockPluginInterface::blockValidate()

File

src/Plugin/Block/CampaignMonitorSubscribeBlock.php, line 130

Class

CampaignMonitorSubscribeBlock
Provides a 'Subscribe' block.

Namespace

Drupal\campaignmonitor\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  $this->configuration['list'] = $form_state
    ->getValue([
    'lists',
    'list',
  ]);
  $this->configuration['list_id'] = $form_state
    ->getValue([
    'lists',
    'list_id',
  ]);
  $this->configuration['list_id_text'] = $form_state
    ->getValue([
    'lists',
    'list_id_text',
  ]);
  $this->configuration['segment_list_id'] = $form_state
    ->getValue([
    'lists',
    'segment_list_id',
  ]);
  $this->configuration['custom_fields_visible'] = $form_state
    ->getValue([
    'custom_fields',
    'custom_fields_visible',
  ]);
}