From ed0b192f5b3260a1104e161310432cf326e0ae59 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 15 Feb 2025 17:02:35 -0500 Subject: [PATCH] Added data-modal-size to the new ajax generic modal functin to define modal size if left blank it will use standard md, also moved Email Message View to use the new ajax modal --- admin_mail_queue.php | 7 ++- .../ajax_admin_mail_queue_message_view.php | 55 ++++++------------- includes/admin_side_nav.php | 2 +- js/generic_modal_loader.js | 21 ++++--- 4 files changed, 37 insertions(+), 48 deletions(-) rename admin_mail_queue_message_view.php => ajax/ajax_admin_mail_queue_message_view.php (59%) diff --git a/admin_mail_queue.php b/admin_mail_queue.php index 841695fc..5259ce96 100644 --- a/admin_mail_queue.php +++ b/admin_mail_queue.php @@ -177,7 +177,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - + diff --git a/admin_mail_queue_message_view.php b/ajax/ajax_admin_mail_queue_message_view.php similarity index 59% rename from admin_mail_queue_message_view.php rename to ajax/ajax_admin_mail_queue_message_view.php index 2204a2d0..6e16384a 100644 --- a/admin_mail_queue_message_view.php +++ b/ajax/ajax_admin_mail_queue_message_view.php @@ -1,24 +1,18 @@ set('Cache.DefinitionImpl', null); // Disable cache by setting a non-existent directory or an invalid one $purifier_config->set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'http' => true, 'https' => true]); $purifier = new HTMLPurifier($purifier_config); -if (isset($_GET['email_id'])) { - $email_id = intval($_GET['email_id']); -} else { - echo "You dont belong here"; - exit(); -} - -$sql = mysqli_query($mysqli, "SELECT * FROM email_queue WHERE email_id = $email_id"); - +$sql = mysqli_query($mysqli, "SELECT * FROM email_queue WHERE email_id = $email_id LIMIT 1"); $row = mysqli_fetch_array($sql); $email_from = nullable_htmlentities($row['email_from']); @@ -42,37 +36,22 @@ if ($email_status == 0) { $email_status_display = "
Sent
$email_sent_at"; } +// Build the dynamic modal title +$title = "$email_subject"; + +// Generate the HTML form content using output buffering. +ob_start(); ?> - - - -
- -
-
-
-
From: ($email_from)"; ?>
-
To: ($email_recipient)"; ?>
-
Subject:
-
-
+ -
-
- + MAINTENANCE