You are here

public function PrivateMessageThreadDeleteForm::buildForm in Opigno messaging 3.x

File

src/Form/PrivateMessageThreadDeleteForm.php, line 17

Class

PrivateMessageThreadDeleteForm
Override the private message thread delete form.

Namespace

Drupal\opigno_messaging\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);
  $form['description']['#markup'] = $this
    ->t('Do you really want to delete this discussion?');

  // Update buttons order, add extra classes.
  $form['actions']['submit']['#attributes'] = [
    'class' => [
      'btn',
      'btn-rounded',
      'btn-border-red',
    ],
  ];
  $form['actions']['submit']['#weight'] = -50;
  $form['actions']['cancel']['#attributes'] = [
    'class' => [
      'btn',
      'btn-rounded',
      'use-ajax',
    ],
  ];
  $form['actions']['submit']['#weight'] = 50;
  return $form;
}