You are here

public function Liveblog::submitForm in Thunder 8.4

Same name and namespace in other branches
  1. 8.2 src/Plugin/Thunder/OptionalModule/Liveblog.php \Drupal\thunder\Plugin\Thunder\OptionalModule\Liveblog::submitForm()
  2. 8.3 src/Plugin/Thunder/OptionalModule/Liveblog.php \Drupal\thunder\Plugin\Thunder\OptionalModule\Liveblog::submitForm()

Overrides AbstractOptionalModule::submitForm

File

src/Plugin/Thunder/OptionalModule/Liveblog.php, line 59

Class

Liveblog
AMP.

Namespace

Drupal\thunder\Plugin\Thunder\OptionalModule

Code

public function submitForm(array $formValues) {
  $this->configFactory
    ->getEditable('liveblog.notification_channel.liveblog_pusher')
    ->set('app_id', $formValues['pusher_app_id'])
    ->set('key', $formValues['pusher_key'])
    ->set('secret', $formValues['pusher_secret'])
    ->set('cluster', $formValues['pusher_cluster'])
    ->save(TRUE);
  if ($formValues['pusher_app_id'] && $formValues['pusher_key'] && $formValues['pusher_secret']) {
    $this->configFactory
      ->getEditable('liveblog.settings')
      ->set('notification_channel', 'liveblog_pusher')
      ->save(TRUE);
  }
}