diff --git a/templates/genericTemplates/toggle.php b/templates/genericTemplates/toggle.php index 426249c..ab36c91 100644 --- a/templates/genericTemplates/toggle.php +++ b/templates/genericTemplates/toggle.php @@ -1 +1,14 @@ -Form->postLink(__('Toggle'), ['action' => 'toggle', $entity->id, $fieldName], ['confirm' => __('Are you sure you want to toggle {0} of {1}?', $fieldName. $entity->id)]) ?> \ No newline at end of file +Form->postLink(__('Toggle'), ['action' => 'toggle', $entity->id, $fieldName], ['confirm' => __('Are you sure you want to toggle `{0}` of {1}?', h($fieldName), h($entity->id))]); +$formHTML = sprintf('
%s
', $form); +$bodyHTML = $formHTML; + +$modalOptions = [ + 'title' => __('Are you sure you want to toggle `{0}` of {1}?', h($fieldName), h($entity->id)), + 'type' => 'confirm', + 'bodyHtml' => $bodyHTML, +]; + +echo $this->Bootstrap->modal($modalOptions); +?> \ No newline at end of file