public function ConfirmDeleteEditorNoteForm::buildForm in Editor Notes 8
Form constructor.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form structure.
Overrides FormInterface::buildForm
File
- src/
Form/ ConfirmDeleteEditorNoteForm.php, line 62
Class
- ConfirmDeleteEditorNoteForm
- Class ConfirmDeleteEditorNoteForm.
Namespace
Drupal\editor_note\FormCode
public function buildForm(array $form, FormStateInterface $form_state, EditorNote $editor_note = NULL, $nojs = NULL) {
$this->editorNote = $editor_note;
$form['use_ajax_container']['description'] = [
'#type' => 'item',
'#markup' => $this
->t('Are you sure you want to remove the note? This action cannot be undone.'),
];
$form['submit'] = [
'#type' => 'submit',
'#value' => $this
->t('Delete'),
'#attributes' => [
'class' => [
'use-ajax',
],
],
'#ajax' => [
'callback' => [
$this,
'submitModalFormAjax',
],
'event' => 'click',
],
];
$form['cancel'] = [
'#type' => 'button',
'#value' => $this
->t('Cancel'),
'#attributes' => [
'class' => [
'use-ajax',
],
],
'#ajax' => [
'callback' => [
$this,
'closeModalForm',
],
'event' => 'click',
],
];
return $form;
}