Internal: Add translated confirmation texts for delete action - refs BT#22121

pull/5882/head
christianbeeznst 11 months ago
parent 42845a9ae7
commit ecdafcc9ab
  1. 13
      assets/js/legacy/app.js
  2. 10
      public/main/admin/user_list.php

@ -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
}
})

@ -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',
]
);

Loading…
Cancel
Save