public function OpignoMessageThreadController::getDeleteThreadForm in Opigno messaging 3.x
Get the delete thread confirmation form.
Parameters
\Drupal\private_message\Entity\PrivateMessageThreadInterface $private_message_thread: The thread to be deleted.
Return value
\Drupal\Core\Ajax\AjaxResponse The AJAX response object.
1 string reference to 'OpignoMessageThreadController::getDeleteThreadForm'
File
- src/
Controller/ OpignoMessageThreadController.php, line 177
Class
- OpignoMessageThreadController
- The Opigno messaging controller.
Namespace
Drupal\opigno_messaging\ControllerCode
public function getDeleteThreadForm(PrivateMessageThreadInterface $private_message_thread) : AjaxResponse {
$response = new AjaxResponse();
$build = [
'#theme' => 'opigno_messaging_confirmation',
'#body' => $this->entityFormBuilder
->getForm($private_message_thread, 'delete'),
];
$response
->addCommand(new RemoveCommand('.modal-ajax'));
$response
->addCommand(new AppendCommand('body', $build));
$response
->addCommand(new InvokeCommand('.modal-ajax', 'modal', [
'show',
]));
return $response;
}