You are here

public function FacebookBoxesRecommendsBlock::blockSubmit in Facebook Boxes 8

Overrides BlockPluginTrait::blockSubmit

File

src/Plugin/Block/FacebookBoxesRecommendsBlock.php, line 109
Contains \Drupal\facebook_boxes\Plugin\Block\FacebookBoxesRecommendsBlock

Class

FacebookBoxesRecommendsBlock
Provides the Facebook Recommends block.

Namespace

Drupal\facebook_boxes\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $this->configuration['fb_rec_domain'] = $values['fb_rec_domain_text'];
  $this->configuration['fb_rec_width'] = $values['fb_rec_width_text'];
  $this->configuration['fb_rec_height'] = $values['fb_rec_height_text'];
  $this->configuration['fb_rec_colorscheme'] = $values['fb_rec_colorscheme_select'];
  $this->configuration['fb_rec_border'] = $values['fb_rec_border_text'];
  $toggles = array();
  foreach ($values['fb_rec_toggles_checks'] as $key => $val) {
    if ($val) {
      $toggles[] = $key;
    }
  }
  $this->configuration['fb_rec_toggles'] = $toggles;
}