mirror of
https://github.com/itflow-org/itflow
synced 2026-09-13 02:05:11 +00:00
Migrated confirm modal to sweetalert2 lib
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
require_once "inc_confirm_modal.php";
|
||||
?>
|
||||
|
||||
<?php
|
||||
@@ -45,6 +44,7 @@ if (basename(dirname($_SERVER['REQUEST_URI'])) === 'guest') { ?>
|
||||
|
||||
<!-- AdminLTE App -->
|
||||
<script src="/libs/adminlte/js/adminlte.min.js"></script>
|
||||
<script src="/libs/sweetalert2/js/sweetalert2.min.js"></script>
|
||||
<script src="/js/autocomplete.js"></script>
|
||||
<script src="/js/app.js"></script>
|
||||
<script src="/js/ajax_modal.js"></script>
|
||||
|
||||
@@ -29,6 +29,7 @@ header("X-Frame-Options: DENY");
|
||||
<!-- Custom Styles -->
|
||||
<link rel="stylesheet" href="/libs/flatpickr/css/flatpickr.min.css">
|
||||
<link rel="stylesheet" href="/libs/tom-select/css/tom-select.bootstrap5.min.css">
|
||||
<link rel="stylesheet" href="/libs/sweetalert2/css/sweetalert2.min.css">
|
||||
<link rel="stylesheet" href="/libs/DataTables/datatables.min.css">
|
||||
<link rel="stylesheet" href="/libs/intl-tel-input/css/intlTelInput.min.css">
|
||||
<link rel="stylesheet" href="/libs/adminlte/css/adminlte.min.css">
|
||||
|
||||
@@ -36,23 +36,8 @@ if (!empty($_SESSION['alert_message'])) {
|
||||
$alert_style = $alert_styles[$alert_type] ?? 'text-bg-secondary';
|
||||
$alert_dark_text = in_array($alert_type, ['warning', 'alert', 'info'], true);
|
||||
|
||||
// Escape everything, then put back only these formatting tags.
|
||||
$alert_allowed_tags = [
|
||||
'<strong>', '</strong>',
|
||||
'<b>', '</b>',
|
||||
'<em>', '</em>',
|
||||
'<i>', '</i>',
|
||||
'<code>', '</code>',
|
||||
'<br>', '<br/>', '<br />',
|
||||
];
|
||||
$alert_safe_message = htmlspecialchars($_SESSION['alert_message'], ENT_QUOTES, 'UTF-8');
|
||||
foreach ($alert_allowed_tags as $alert_tag) {
|
||||
$alert_safe_message = str_replace(
|
||||
htmlspecialchars($alert_tag, ENT_QUOTES, 'UTF-8'),
|
||||
$alert_tag,
|
||||
$alert_safe_message
|
||||
);
|
||||
}
|
||||
// Escaping lives in one place now - see alertMessageHtml() in functions/sanitize.php
|
||||
$alert_safe_message = alertMessageHtml($_SESSION['alert_message']);
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<div class="modal fade" id="confirmationModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="confirmationModalLabel">Confirm</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Are you sure?
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-primary" id="confirmSubmitBtn">Yes</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user