diff options
author | Andrew Dolgov <[email protected]> | 2017-02-09 23:19:26 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-02-09 23:19:26 +0300 |
commit | 70c0a8c2e020f30e1b9f5cd8de18e01c80e0a1c6 (patch) | |
tree | 3a02272d5ae45ec6221b7c34096a832f5605c382 /include | |
parent | 3188e863b399446563c4952309f818c61bcfc079 (diff) |
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.
Diffstat (limited to 'include')
-rw-r--r-- | include/functions2.php | 15 |
1 files changed, 15 insertions, 0 deletions
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 ""; + } + } ?> |