class PrivateMessageThreadDeleteForm in Opigno messaging 3.x
Override the private message thread delete form.
Hierarchy
- class \Drupal\opigno_messaging\Form\PrivateMessageThreadDeleteForm extends \Drupal\private_message\Form\PrivateMessageThreadDeleteForm
Expanded class hierarchy of PrivateMessageThreadDeleteForm
1 file declares its use of PrivateMessageThreadDeleteForm
File
- src/
Form/ PrivateMessageThreadDeleteForm.php, line 12
Namespace
Drupal\opigno_messaging\FormView source
class PrivateMessageThreadDeleteForm extends DeleteFormBase {
/**
* {@inheritdoc}
*/
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;
}
/**
* {@inheritdoc}
*/
public function getQuestion() {
return $this
->t('Do you really want to delete this discussion?');
}
/**
* {@inheritdoc}
*/
public function getCancelUrl() {
return Url::fromRoute('opigno_messaging.close_modal');
}
/**
* {@inheritdoc}
*/
public function getConfirmText() {
return $this
->t('Delete');
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PrivateMessageThreadDeleteForm:: |
public | function | ||
PrivateMessageThreadDeleteForm:: |
public | function | ||
PrivateMessageThreadDeleteForm:: |
public | function | ||
PrivateMessageThreadDeleteForm:: |
public | function |