You are here

public function SocialFooterPoweredByBlock::blockSubmit in Open Social 10.0.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_footer/src/Plugin/Block/SocialFooterPoweredByBlock.php \Drupal\social_footer\Plugin\Block\SocialFooterPoweredByBlock::blockSubmit()
  2. 10.1.x modules/social_features/social_footer/src/Plugin/Block/SocialFooterPoweredByBlock.php \Drupal\social_footer\Plugin\Block\SocialFooterPoweredByBlock::blockSubmit()
  3. 10.2.x modules/social_features/social_footer/src/Plugin/Block/SocialFooterPoweredByBlock.php \Drupal\social_footer\Plugin\Block\SocialFooterPoweredByBlock::blockSubmit()

Overrides BlockPluginTrait::blockSubmit

File

modules/social_features/social_footer/src/Plugin/Block/SocialFooterPoweredByBlock.php, line 147

Class

SocialFooterPoweredByBlock
Provides a 'Powered by' block.

Namespace

Drupal\social_footer\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  $logo = '';
  if ($items = $form_state
    ->getValue('logo')) {

    /** @var \Drupal\file\FileInterface $file */
    $file = $this->storage
      ->load($logo = $items[0]);
    $file
      ->setPermanent();
    $file
      ->save();
  }
  $this->configuration['logo'] = $logo;
  $this->configuration['text'] = $form_state
    ->getValue('text');
  $this->configuration['link'] = $form_state
    ->getValue('link');
}