PrivateMessageThreadDeleteForm.php in Opigno messaging 3.x
File
src/Form/PrivateMessageThreadDeleteForm.php
View source
<?php
namespace Drupal\opigno_messaging\Form;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\private_message\Form\PrivateMessageThreadDeleteForm as DeleteFormBase;
class PrivateMessageThreadDeleteForm extends DeleteFormBase {
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?');
$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;
}
public function getQuestion() {
return $this
->t('Do you really want to delete this discussion?');
}
public function getCancelUrl() {
return Url::fromRoute('opigno_messaging.close_modal');
}
public function getConfirmText() {
return $this
->t('Delete');
}
}