You are here

public function SidrTrigger::blockSubmit in Sidr: Accessible Mobile Menus 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/Block/SidrTrigger.php \Drupal\sidr\Plugin\Block\SidrTrigger::blockSubmit()
  2. 8.2 src/Plugin/Block/SidrTrigger.php \Drupal\sidr\Plugin\Block\SidrTrigger::blockSubmit()

Overrides BlockPluginTrait::blockSubmit

File

src/Plugin/Block/SidrTrigger.php, line 274

Class

SidrTrigger
Provides a trigger button with Sidr integration.

Namespace

Drupal\sidr\Plugin\Block

Code

public function blockSubmit($form, FormStateInterface $form_state) {
  parent::blockSubmit($form, $form_state);
  $values = $form_state
    ->getValues();
  $values = $values['basic'] + $values['advanced'];
  $keys = array_keys($this
    ->defaultConfiguration());
  foreach ($keys as $key) {
    switch ($key) {
      case 'sidr_renaming':
      case 'sidr_displace':
        $this->configuration[$key] = (bool) $values[$key];
        break;
      default:
        $this->configuration[$key] = $values[$key];
    }
  }
}