You are here

public function FlotBlock::blockSubmit in Flot 8

Overrides BlockPluginTrait::blockSubmit

File

src/Plugin/Block/FlotBlock.php, line 87

Class

FlotBlock
Provides Flot Block.

Namespace

Drupal\flot\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  $textarea_value = $form_state
    ->getValue('flot_block_settings');
  $settings = [];
  $settings['label'] = $form_state
    ->getValue('label');
  $settings['flot_block_type'] = $form_state
    ->getValue('flot_block_type');
  $line_array = explode("\n", $textarea_value);
  foreach ($line_array as $line) {
    $settings['flot_block_settings']['data'][] = $line;
  }
  $this->configuration = $settings;
}