From 70c0a8c2e020f30e1b9f5cd8de18e01c80e0a1c6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 9 Feb 2017 23:19:26 +0300 Subject: pass several image files used in notify messages to frontend as base64 to prevent broken error messages in case network connection is down. also, update some close buttons to show correct cursor. --- include/functions2.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/functions2.php') diff --git a/include/functions2.php b/include/functions2.php index 6674c7734..56676b165 100644 --- a/include/functions2.php +++ b/include/functions2.php @@ -44,6 +44,11 @@ $params['simple_update'] = defined('SIMPLE_UPDATE_MODE') && SIMPLE_UPDATE_MODE; + $params["icon_alert"] = base64_img("images/alert.png"); + $params["icon_information"] = base64_img("images/information.png"); + $params["icon_cross"] = base64_img("images/cross.png"); + $params["icon_indicator_white"] = base64_img("images/indicator_white.gif"); + return $params; } @@ -2485,4 +2490,14 @@ return $errors[$code]; } + + function base64_img($filename) { + if (file_exists($filename)) { + $ext = pathinfo($filename, PATHINFO_EXTENSION); + + return "data:image/$ext;base64," . base64_encode(file_get_contents($filename)); + } else { + return ""; + } + } ?> -- cgit v1.2.3-54-g00ecf