summaryrefslogtreecommitdiff
path: root/src/web/_views/_template/toast.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/_views/_template/toast.php')
-rw-r--r--src/web/_views/_template/toast.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/web/_views/_template/toast.php b/src/web/_views/_template/toast.php
new file mode 100644
index 0000000..902955c
--- /dev/null
+++ b/src/web/_views/_template/toast.php
@@ -0,0 +1,22 @@
+<?php /* Copyright (c) 2024 Freya Murphy */ ?>
+<?php /* vi: syntax=php */ ?>
+<?php
+ $params = array();
+
+ if ($detail)
+ $params[] = lang('api_column_' . $detail);
+
+ if ($hint)
+ $params[] = $hint;
+
+ $lang_msg = lang($msg, '', sub: $params);
+ if(!$lang_msg)
+ $lang_msg = $msg;
+ else
+ $lang_msg = ucfirst($lang_msg);
+
+?>
+<div class="toast <?=$type?>">
+ <?=$lang_msg?>
+ <?=ilang('action_close', class: 'action-close-toast')?>
+</div>