From 336121d758241512d9714502b539aaf558bbe7c4 Mon Sep 17 00:00:00 2001 From: Purple Date: Sun, 18 Jan 2026 16:03:40 +0000 Subject: [PATCH] Add missing showNotification function to settings.php - Function was being called but never defined - Added showNotification that uses showToast from app.js when available - Includes fallback toast implementation for robustness Co-Authored-By: Claude Opus 4.5 --- webapp/settings.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/webapp/settings.php b/webapp/settings.php index c118903..a4c205c 100644 --- a/webapp/settings.php +++ b/webapp/settings.php @@ -883,6 +883,23 @@ require_once __DIR__ . '/includes/header.php'; +// Notification helper - uses showToast from app.js if available, otherwise creates simple alert +function showNotification(message, type = "success") { + if (typeof showToast === "function") { + showToast(message, type); + } else { + // Fallback toast implementation + const container = document.getElementById("toastContainer") || document.body; + const toast = document.createElement("div"); + toast.className = `toast ${type}`; + toast.style.cssText = "position: fixed; bottom: 20px; right: 20px; padding: 12px 20px; border-radius: 8px; color: white; z-index: 10000; animation: slideIn 0.3s ease;"; + toast.style.background = type === "error" ? "#dc3545" : type === "info" ? "#17a2b8" : "#28a745"; + toast.textContent = message; + container.appendChild(toast); + setTimeout(() => toast.remove(), 4000); + } +} + // Initialize settings page document.addEventListener("DOMContentLoaded", function() { const currentTab = "' . $currentTab . '";