You are here

public function FacebookBoxesLikeBlock::blockSubmit in Facebook Boxes 8

Overrides BlockPluginTrait::blockSubmit

File

src/Plugin/Block/FacebookBoxesLikeBlock.php, line 102
Contains \Drupal\facebook_boxes\Plugin\Block\FacebookBoxesLikeBlock

Class

FacebookBoxesLikeBlock
Provides the Facebook Like block.

Namespace

Drupal\facebook_boxes\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $this->configuration['fb_like_url'] = $values['fb_like_url_text'];
  $this->configuration['fb_like_width'] = $values['fb_like_width_text'];
  $this->configuration['fb_like_height'] = $values['fb_like_height_text'];
  $this->configuration['fb_like_colorscheme'] = $values['fb_like_colorscheme_select'];
  $this->configuration['fb_like_border'] = $values['fb_like_border_text'];
  $toggles = array();
  foreach ($values['fb_like_toggles_options'] as $key => $val) {
    if ($val) {
      $toggles[] = $key;
    }
  }
  $this->configuration['fb_like_toggles'] = $toggles;
}