You are here

public function JuicerEmbedFeedBlock::blockSubmit in Juicer - Social Media Feed Aggregator 8

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/JuicerEmbedFeedBlock.php, line 163

Class

JuicerEmbedFeedBlock
Provides a Juicer embed block.

Namespace

Drupal\juicerio\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  parent::blockSubmit($form, $form_state);
  $values = $form_state
    ->getValues();
  $delta = $this
    ->getDerivativeId();
  $this->configuration[$delta . '_feed_id'] = $values['juicer'][$delta . '_feed_id'];
  $this->configuration[$delta . '_post_number'] = $values['juicer'][$delta . '_post_number'];
  $this->configuration[$delta . '_infinite_pages'] = $values['juicer'][$delta . '_infinite_pages'];
  $this->configuration[$delta . '_gutter_amt'] = $values['juicer'][$delta . '_gutter_amt'];
  $this->configuration[$delta . '_column_number'] = $values['juicer'][$delta . '_column_number'];
  $this->configuration[$delta . '_filter'] = $values['juicer'][$delta . '_filter'];
  $this->configuration[$delta . '_style'] = $values['juicer'][$delta . '_style'];
}