You are here

public function EndMeetingConfirmForm::submitForm in BigBlueButton 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

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

Overrides FormInterface::submitForm

File

modules/bbb_node/src/Form/EndMeetingConfirmForm.php, line 69

Class

EndMeetingConfirmForm
Provides an administration settings form.

Namespace

Drupal\bbb_node\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $node = $this
    ->getRequest()
    ->get('node');
  $request = $this->nodeMeeting
    ->end($node);
  if ($request === FALSE) {
    $this
      ->messenger()
      ->addError($this
      ->t('There was an error terminating the meeting.'));
  }
  else {
    $this
      ->messenger()
      ->addStatus($this
      ->t('The meeting has been terminated.'));
  }
  return new RedirectResponse(Url::fromRoute('entity.node.canonical', [
    'node' => $node
      ->id(),
  ], [
    'absolute' => TRUE,
  ]));
}