diff --git a/assets/js/legacy/app.js b/assets/js/legacy/app.js index f8763d5bdb..c15dd55901 100644 --- a/assets/js/legacy/app.js +++ b/assets/js/legacy/app.js @@ -133,26 +133,23 @@ $(function () { // MODAL DELETE CONFIRM $(".delete-swal").click(function (e) { - e.preventDefault() // Prevent the href from redirecting directly + e.preventDefault() var url = $(this).attr("href") var title = $(this).data("title") || $(this).attr("title") + var confirmText = $(this).data("confirm-text") || 'Yes' + var cancelText = $(this).data("cancel-text") || 'Cancel' Swal.fire({ title: title, text: "", icon: "warning", showCancelButton: true, - cancelButtonText: "Cancel", + cancelButtonText: cancelText, confirmButtonColor: "#3085d6", cancelButtonColor: "#d33", - confirmButtonText: "Yes", + confirmButtonText: confirmText, }).then((result) => { if (result.value) { - /*Swal.fire( - 'Deleted!', - 'Your file has been deleted.', - 'success' - )*/ window.location.href = url } }) diff --git a/public/main/admin/user_list.php b/public/main/admin/user_list.php index 9ebc3a259b..c91305ced0 100644 --- a/public/main/admin/user_list.php +++ b/public/main/admin/user_list.php @@ -525,6 +525,8 @@ function modify_deleted_filter(int $user_id, string $url_params, array $row): st [ 'title' => get_lang('Restore'), 'data-title' => addslashes(api_htmlentities(get_lang("Please confirm your choice"))), + 'data-confirm-text' => get_lang('Yes'), + 'data-cancel-text' => get_lang('Cancel'), 'class' => 'delete-swal', ] ); @@ -542,6 +544,8 @@ function modify_deleted_filter(int $user_id, string $url_params, array $row): st [ 'title' => get_lang('Delete permanently'), 'data-title' => addslashes(api_htmlentities(get_lang("Please confirm your choice"))), + 'data-confirm-text' => get_lang('Yes'), + 'data-cancel-text' => get_lang('Cancel'), 'class' => 'delete-swal', ] ); @@ -713,6 +717,8 @@ function modify_filter($user_id, $url_params, $row): string [ 'data-title' => addslashes(api_htmlentities(get_lang("Please confirm your choice"))), 'class' => 'delete-swal', + 'data-confirm-text' => get_lang('Yes'), + 'data-cancel-text' => get_lang('Cancel'), 'title' => get_lang('Anonymize'), ] ); @@ -746,6 +752,8 @@ function modify_filter($user_id, $url_params, $row): string [ 'data-title' => addslashes(api_htmlentities(get_lang("Please confirm your choice"))), 'title' => get_lang('Delete'), + 'data-confirm-text' => get_lang('Yes'), + 'data-cancel-text' => get_lang('Cancel'), 'class' => 'delete-swal', ] ); @@ -789,6 +797,8 @@ function modify_filter($user_id, $url_params, $row): string [ 'data-title' => addslashes(api_htmlentities(get_lang("Please confirm your choice"))), 'title' => get_lang('Delete'), + 'data-confirm-text' => get_lang('Yes'), + 'data-cancel-text' => get_lang('Cancel'), 'class' => 'delete-swal', ] );