You are here

public function SimpleGateway::submitConfigurationForm in SMS simple gateway 8

Saves the configuration values.

Parameters

array $form: The configuration form.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

Overrides SmsGatewayPluginBase::submitConfigurationForm

File

src/Plugin/SmsGateway/SimpleGateway.php, line 246

Class

SimpleGateway
This plugin handles sending SMSes through most GET & POST based SMS Gateways.

Namespace

Drupal\sms_simplegateway\Plugin\SmsGateway

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  $this->configuration['method'] = trim($form_state
    ->getValue([
    'send',
    'method',
  ]));
  $this->configuration['authorization'] = trim($form_state
    ->getValue([
    'send',
    'authorization',
  ]));
  $this->configuration['content_type'] = trim($form_state
    ->getValue([
    'send',
    'content_type',
  ]));
  $this->configuration['base_url'] = trim($form_state
    ->getValue([
    'send',
    'base_url',
  ]));
  $this->configuration['user_field'] = trim($form_state
    ->getValue([
    'send',
    'user_field',
  ]));
  $this->configuration['user_value'] = trim($form_state
    ->getValue([
    'send',
    'user_value',
  ]));
  $this->configuration['pass_field'] = trim($form_state
    ->getValue([
    'send',
    'pass_field',
  ]));
  $this->configuration['pass_value'] = trim($form_state
    ->getValue([
    'send',
    'pass_value',
  ]));
  $this->configuration['sender_field'] = trim($form_state
    ->getValue([
    'send',
    'sender_field',
  ]));
  $this->configuration['sender_value'] = trim($form_state
    ->getValue([
    'send',
    'sender_value',
  ]));
  $this->configuration['number_field'] = trim($form_state
    ->getValue([
    'send',
    'number_field',
  ]));
  $this->configuration['number_prefix'] = trim($form_state
    ->getValue([
    'send',
    'number_prefix',
  ]));
  $this->configuration['message_field'] = trim($form_state
    ->getValue([
    'send',
    'message_field',
  ]));
  $this->configuration['extra_params'] = trim($form_state
    ->getValue([
    'send',
    'extra_params',
  ]));
  $this->configuration['receive_number_field'] = trim($form_state
    ->getValue('receive_number_field'));
  $this->configuration['receive_message_field'] = trim($form_state
    ->getValue('receive_message_field'));
  $this->configuration['receive_gwnumber_field'] = trim($form_state
    ->getValue('receive_gwnumber_field'));
}